Guest User

Untitled

a guest
Nov 25th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.98 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.4
  8. * @ Author : DeZender
  9. * @ Release on : 21.10.2015
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. $app = require_once __DIR__ . "/bootstrap.php";
  15. Symfony\Component\Debug\ErrorHandler::register();
  16. Symfony\Component\Debug\ExceptionHandler::register();
  17. $app["debug"] = true;
  18. $app->get("rest/Pengguna", "Admin\\Administrasi::Pengguna");
  19. $app->get("/Test", function ($request) use ($app) {
  20.  
  21. return "test";
  22. });
  23. $app->get("login", function ($request) use ($app) {
  24.  
  25. $config = $app["xond.config"];
  26. $cekInstall = file_exists("install/install_pass");
  27. if (!$cekInstall)
  28. {
  29. return $app->redirect("/install_config");
  30. }
  31. if ($app["session"]->get("username"))
  32. {
  33. return $app["twig"]->render("main.html", array("judul" => JUDUL, "bosnya" => BOSNYA, "id_level_wilayah" => ID_LEVEL_WILAYAH, "kode_wilayah" => KODE_WILAYAH, "apptitle" => $config["nama_aplikasi"], "error" => $app["security.last_error"]($request), "last_username" => $app["session"]->get("_security.last_username")));
  34. }
  35. return $app["twig"]->render(LOGIN_PAGE . ".html", array("judul" => JUDUL, "bosnya" => BOSNYA, "id_level_wilayah" => ID_LEVEL_WILAYAH, "kode_wilayah" => KODE_WILAYAH, "logo_filename" => LOGO_FILENAME, "tahun" => date("Y"), "apptitle" => $config["nama_aplikasi"], "error" => $app["security.last_error"]($request), "last_username" => $app["session"]->get("_security.last_username")));
  36. });
  37. $app->get("/", function ($request) use ($app) {
  38.  
  39. $config = $app["xond.config"];
  40. $cekInstall = file_exists("install/install_pass");
  41. if (!$cekInstall)
  42. {
  43. return $app->redirect("/install_config");
  44. }
  45. if (HARUS_LOGIN == true)
  46. {
  47. if ($app["session"]->get("username"))
  48. {
  49. return $app["twig"]->render("main.html", array("judul" => JUDUL, "bosnya" => BOSNYA, "id_level_wilayah" => ID_LEVEL_WILAYAH, "kode_wilayah" => KODE_WILAYAH, "apptitle" => $config["nama_aplikasi"], "error" => $app["security.last_error"]($request), "last_username" => $app["session"]->get("_security.last_username")));
  50. }
  51. return $app["twig"]->render(LOGIN_PAGE . ".html", array("judul" => JUDUL, "bosnya" => BOSNYA, "id_level_wilayah" => ID_LEVEL_WILAYAH, "kode_wilayah" => KODE_WILAYAH, "logo_filename" => LOGO_FILENAME, "apptitle" => $config["nama_aplikasi"]));
  52. }
  53. return $app["twig"]->render("main.html", array("judul" => JUDUL, "bosnya" => BOSNYA, "id_level_wilayah" => ID_LEVEL_WILAYAH, "kode_wilayah" => KODE_WILAYAH, "apptitle" => $config["nama_aplikasi"], "error" => $app["security.last_error"]($request), "last_username" => $app["session"]->get("_security.last_username")));
  54. })->bind("homepage");
  55. $app->get("install_config_sto", "Admin\\Install::install_config_sto");
  56. $app->get("install_config", "Admin\\Install::install_config_sto");
  57. $app->post("install_manual_sto", "Admin\\Install::install_manual_sto");
  58. $app->get("/install_manual", function ($request) use ($app) {
  59.  
  60. $config = $app["xond.config"];
  61. $add = $request->get("add");
  62. $cekInstall = file_exists("install/install_pass");
  63. if ($cekInstall)
  64. {
  65. return $app->redirect("/");
  66. }
  67. return $app["twig"]->render("install_kipy.html", array("error_msg" => "", "judul" => JUDUL, "bosnya" => BOSNYA, "id_level_wilayah" => ID_LEVEL_WILAYAH, "kode_wilayah" => KODE_WILAYAH, "logo_filename" => LOGO_FILENAME));
  68. });
  69. $app->post("/prosesPilihDapodik", "Admin\\SwitchingApp::SwitchingApp");
  70. $app->get("/login", function ($request) use ($app) {
  71.  
  72. $config = $app["xond.config"];
  73. if (100 < strlen($app["security.last_error"]($request)))
  74. {
  75. $errorMsg = "Terjadi galat. Mohon hubungi sysadmin";
  76. }
  77. else
  78. {
  79. $errorMsg = "";
  80. }
  81. return $app["twig"]->render(LOGIN_PAGE . ".html", array("apptitle" => $config["nama_aplikasi"], "login_background_style" => $config["login_background_style"], "login_header_pic" => $config["login_header_pic"], "error" => $errorMsg, "last_username" => $app["session"]->get("_security.last_username")));
  82. });
  83. $app["security.firewalls"] = array("login_path" => array("pattern" => "^/login\$", "anonymous" => true), "passgen" => array("pattern" => "^/passgen.*\$", "anonymous" => true), "default" => array("pattern" => "^/.*\$", "anonymous" => true, "form" => array("login_path" => "/login", "check_path" => "/login_check"), "logout" => array("logout_path" => "/logout", "invalidate_session" => false), "users" => $app->share(function ($app) {
  84.  
  85. return new Xond\Auth\UserProvider($app);
  86. })));
  87. $app["security.access_rules"] = array(array("^/login\$", "IS_AUTHENTICATED_ANONYMOUSLY"), array("^/.+\$", "IS_AUTHENTICATED_ANONYMOUSLY"));
  88. $app->before(function ($request) use ($app) {
  89.  
  90. $token = $app["security"]->getToken();
  91. if (null !== $token)
  92. {
  93. $user = $token->getUser();
  94. if (is_object($user))
  95. {
  96. $cGen = new Xond\Util\ExtCookieGenerator();
  97. .....................................................................................................................
  98. ...................................................................
  99. ...............
Advertisement
Add Comment
Please, Sign In to add comment