Guest User

Untitled

a guest
Jun 3rd, 2014
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for Zend Encoder/SafeGuard & PhpExpress)
  6. *
  7. * @ Version : 2.0.0.3
  8. * @ Author : DeZender
  9. * @ Release on : 06.05.2013
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class Paypals_AdminController {
  15.  
  16. public function preDispatch() {
  17. $this->view->children = (array("header_part" => "admin/layout/header_part", "footer_part" => "admin/layout/footer_part"));
  18. if (!WM_Rebuild::allow($this->sysModule())) {
  19. JO_Session::set("error", $this->translate("Error: Error with license file!"));
  20. $this->redirect($this->getRequest()->getServer("HTTP_REFERER"));
  21. }
  22. }
  23.  
  24. public function installAction() {
  25. $this->noViewRenderer();
  26. $ext = Extensions_Model_Admin::getExtension("paypals");
  27. if (!WM_Users::allow($this->getRequest()->getModule(), $this->getRequest()->getController(), $this->getRequest()->getAction())) {
  28. JO_Session::set("error_permision", $this->translate("You do not have permission to this action"));
  29. $this->redirect(WM_Router::create($this->getRequest()->getBaseUrl() . "?module=extensions&controller=admin&group_id=" . $ext["group_id"]));
  30. }
  31. Extensions_Model_Admin::installExtensions("paypals");
  32. JO_Session::set("success", $this->translate("The extension was installed successfuly"));
  33. $this->redirect(WM_Router::create($this->getRequest()->getBaseUrl() . "?module=extensions&controller=admin&group_id=" . $ext["group_id"]));
  34. }
  35.  
  36. public function settingsAction() {
  37. $ext = Extensions_Model_Admin::getExtension("paypals");
  38. $request = $this->getRequest();
  39. if (JO_Session::get("successfu_edite")) {
  40. $this->view->successfu_edite = true;
  41. JO_Session::clear("successfu_edite");
  42. }
  43. if (JO_Session::get("error_permision")) {
  44. $this->view->error_permision = JO_Session::get("error_permision");
  45. JO_Session::clear("error_permision");
  46. }
  47. if ($request->isPost()) {
  48. if (!WM_Users::allow($this->getRequest()->getModule(), $this->getRequest()->getController(), $this->getRequest()->getAction())) {
  49. $this->view->error = $this->translate("You do not have permission to this action");
  50. }
  51. else {
  52. if ($this->validate()) {
  53. Settings_Model_Settings::updateAll(array("paypals" => $request->getPost("paypals")));
  54. JO_Session::set("successfu_edite", true);
  55. $this->redirect(WM_Router::create($this->getRequest()->getBaseUrl() . "?module=paypals&controller=admin&action=settings"));
  56. }
  57. else {
  58. $this->view->error = implode("<br />", $this->error);
  59. }
  60. }
  61. }
  62. ..................................................................
  63. ..............................
  64. ............
Advertisement
Add Comment
Please, Sign In to add comment