Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ActivateController extends ActivateAppController
- {
- public $name = 'Activate';
- public $uses = null;
- public $components = null;
- public function beforeFilter()
- {
- parent::beforeFilter();
- $this->layout = "install";
- App::import("Component", "Session");
- $this->Session = new SessionComponent;
- }
- protected function _check()
- {
- if (file_exists(CONFIGS . "code.yml")) {
- $key = file_get_contents(CONFIGS . "code.yml");
- $mykey=md5(md5(CONFIGS . " - " . Router::url("/") . " - " . $_SERVER["SERVER_ADDR"]) . "-" . "kJpdRmvVMBzETXqMdNcKNFCJGDuPdQSgpBhLBLLZPpQnUZeSaHmsZjHWVWvreR");
- $mykey1=md5(md5(CONFIGS . " - " . Router::url("/") . " - " . $_SERVER["SERVER_NAME"]) . "-" . "kJpdRmvVMBzETXqMdNcKNFCJGDuPdQSgpBhLBLLZPpQnUZeSaHmsZjHWVWvreR");
- if ($key == $mykey || $key == $mykey1) {
- $this->Session->setFlash("Already Activated");
- $this->redirect("/");
- }
- }
- }
- public function index()
- {
- $this->_check();
- if (isset($_GET["message"])) {
- $this->Session->setFlash(base64_decode($_GET["message"]), "default", array(
- "class" => "error"
- ));
- $this->redirect("/activate");
- }
- $this->set("title_for_layout", __("Activate", true));
- $mykey1=md5(CONFIGS . " - " . Router::url("/") . " - " . $_SERVER["SERVER_NAME"]);
- $this->set("validation_code", $mykey1);
- $this->set("url", Router::url("/", true));
- }
- public function acti($code = null)
- {
- ${"GLOBALS"}["gzxucl"] = "code";
- file_put_contents(CONFIGS . "code.yml", ${${"GLOBALS"}["gzxucl"]});
- $this->Session->setFlash("Application activated");
- $this->redirect("/");
- }
- public function del($code = null)
- {
- $key = file_get_contents(CONFIGS . "code.yml");
- if ($key == $code) {
- file_put_contents(CONFIGS . "code.yml", "ERROR");
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement