예제 #1
0
 function actionRegister()
 {
     if (Database::GetOne("config", array("mod" => "auth"))['allowRegister'] == 0 and $_SESSION['invited'] !== true) {
         echo "<script>alert('Регистрация закрыта'); window.location = '/';</script>";
         die;
     }
     if ($res = Player::register($_POST['login'], $_POST['password'], $_POST['email'])) {
         $_SESSION['id'] = $res;
         if ($_SESSION['invited'] === true) {
             $_SESSION['invited'] = false;
         }
         call_user_func("onPlayerRegister", $_POST['login'], $_POST['password'], $_POST['email']);
         @header("Location: /cabinet");
         die("<script>location.href = '/cabinet';</script>");
     } else {
         @header("Location: /index?result=regerror");
         die("<script>location.href = '/index?result=regerror';</script>");
     }
 }
예제 #2
0
 /** public function register
  *		Registers a new player in the extend table
  *		also calls the parent register function
  *		which performs some validity checks
  *
  * @param void
  * @action creates a new player in the database
  * @return bool success
  */
 public function register()
 {
     call(__METHOD__);
     try {
         parent::register();
     } catch (MyException $e) {
         call('Exception Thrown: ' . $e->getMessage());
         throw $e;
     }
     if ($this->id) {
         // add the user to the table
         $this->_mysql->insert(self::EXTEND_TABLE, array('player_id' => $this->id));
         // update the last_online time so we don't break things later
         $this->_mysql->insert(self::EXTEND_TABLE, array('last_online' => NULL), " WHERE player_id = '{$this->id}' ");
     }
 }
예제 #3
0
 /** public function register
  *		Registers a new player in the extend table
  *		also calls the parent register function
  *		which performs some validity checks
  *
  * @param void
  * @action creates a new player in the database
  * @return bool success
  */
 public function register()
 {
     call(__METHOD__);
     try {
         parent::register();
     } catch (MyException $e) {
         call('Exception Thrown: ' . $e->getMessage());
         throw $e;
     }
     if ($this->id) {
         $this->_mysql->insert(self::EXTEND_TABLE, array('player_id' => $this->id));
     }
 }
예제 #4
0
     break;
 case 3:
     if (isset($_POST['name'])) {
         $in = array('modules' => array(), 'active' => '1', 'id' => uniqid()) + $_POST;
         Database::Insert("config", $in);
         foreach ($config as $as) {
             Database::Insert("config", $as);
         }
         Database::Insert("scripts", array('name' => 'main', 'code' => 'ZnVuY3Rpb24gc2NyaXB0RW5naW5lSW5pdCgpIHsNCiAgcmV0dXJuIDE7DQp9DQoNCmZ1bmN0aW9uIG9uUGxheWVyTG9naW4oJGxvZ2luLCAkcGFzc3dvcmQsICRzdWNjZXNzKSB7DQogIHJldHVybiAxOw0KfQ0KDQpmdW5jdGlvbiBvblBsYXllclJlZ2lzdGVyKCRsb2dpbiwgJHBhc3N3b3JkLCAkZW1haWwpIHsNCiAgcmV0dXJuIDE7DQp9DQoNCmZ1bmN0aW9uIEV2ZW50VGltZXJFeHBpcmVkKCRpZCkgew0KICByZXR1cm4gMTsNCn0NCg0KZnVuY3Rpb24gVXNlSXRlbSgkaWQsICRpdGVtKSB7DQogIHJldHVybiAxOw0KfQ0KDQpmdW5jdGlvbiBvblJvdXRlZCgkZHJpdmVyLCAkYWN0aW9uLCAkbGluaykgew0KICByZXR1cm4gMTsNCn0NCg0KZnVuY3Rpb24gb25DbGllbnRDYWxsKCRpbnB1dCwgJHBhcmFtcykgew0KICByZXR1cm4gMTsNCn0NCg0KZnVuY3Rpb24gb25BcGlNZXRob2RDYWxsZWQoJG1ldGhvZCwgJHJlcXVlc3QpIHsNCiAgcmV0dXJuIGZhbHNlOw0KfQ0KDQpmdW5jdGlvbiBvbkRpYWxvZ1Jlc3BvbnNlKCRkaWFsb2dpZCwgJGFuc3dlcikgew0KICByZXR1cm4gMTsNCn0NCg0KZnVuY3Rpb24gb25QbGF5ZXJDb250ZXh0TWVudSgkbGlzdGl0ZW0sICR0YXJnZXQpIHsNCiAgcmV0dXJuIDE7DQp9'));
         echo "<div class='alert alert-success'>База данных заполнена. <a href='?step=4'>Перейти к последнему шагу</a></div>";
     }
     raptor_print('PGZvcm0gYWN0aW9uPSIiIG1ldGhvZD0iUE9TVCI+DQoJCTxkaXYgY2xhc3M9ImZvcm0tZ3JvdXAiPg0KCQkJPGxhYmVsPtCd0LDQt9Cy0LDQvdC40LUg0LjQs9GA0Ys8L2xhYmVsPg0KCQkJPGlucHV0IGNsYXNzPSJmb3JtLWNvbnRyb2wiIG5hbWU9Im5hbWUiIHZhbHVlPSIiPg0KCQk8L2Rpdj4NCgkJPGRpdiBjbGFzcz0iZm9ybS1ncm91cCI+DQoJCQk8bGFiZWw+0JLQtdGA0YHQuNGPINC40LPRgNGLPC9sYWJlbD4NCgkJCTxpbnB1dCBjbGFzcz0iZm9ybS1jb250cm9sIiBuYW1lPSJ2ZXJzaW9uIiB2YWx1ZT0iIj4NCgkJPC9kaXY+DQoJCTxkaXYgY2xhc3M9ImZvcm0tZ3JvdXAiPg0KCQkJPGxhYmVsPlB1YmxpYyBLZXkgKNC/0YPQsdC70LjRh9C90YvQuSDQutC70Y7RhyDQtNC70Y8gQVBJKTwvbGFiZWw+DQoJCQk8aW5wdXQgY2xhc3M9ImZvcm0tY29udHJvbCIgbmFtZT0icHVibGljX2tleSIgdmFsdWU9IiI+DQoJCTwvZGl2Pg0KCQk8ZGl2IGNsYXNzPSJmb3JtLWdyb3VwIj4NCgkJCTxsYWJlbD5Qcml2YXRlIEtleSAo0L/RgNC40LLQsNGC0L3Ri9C5INC60LvRjtGHINC00LvRjyBBUEk7INC90LUg0YHQvtC+0LHRidCw0LnRgtC1INC10LPQviDRgdGC0L7RgNC+0L3QvdC40Lwg0LvQuNGG0LDQvCk8L2xhYmVsPg0KCQkJPGlucHV0IGNsYXNzPSJmb3JtLWNvbnRyb2wiIG5hbWU9InByaXZhdGVfa2V5IiB2YWx1ZT0iIj4NCgkJPC9kaXY+DQoJCTxidXR0b24gdHlwZT0ic3VibWl0IiBjbGFzcz0iYnRuIGJ0bi1kZWZhdWx0Ij7QodC+0YXRgNCw0L3QuNGC0Yw8L2J1dHRvbj4NCgk8L2Zvcm0+');
     break;
 case 4:
     if (isset($_POST['name'])) {
         $id = Player::register($_POST['name'], $_POST['password'], $_POST['email']);
         Char::create(array('name' => $_POST['name'], 'player' => $id, 'about' => $_POST['about'], 'admin' => '1'));
         if (file_put_contents(CACHE_ROOT . SEPARATOR . "installed.cache", "What are you looking for, admin?")) {
             echo '<h3>Игра полностью установлена. <a href="/">Вход</a></h3>';
         } else {
             echo '<h3>Ошибка при создании файла завершения установки. <a href="?step=4&file=1">Повторить попытку</a></h3>';
         }
     }
     if (isset($_GET['file'])) {
         if (file_put_contents(CACHE_ROOT . SEPARATOR . "installed.cache", "What are you looking for, admin?")) {
             echo '<h3>Игра полностью установлена. <a href="/">Вход</a></h3>';
         } else {
             echo '<h3>Ошибка при создании файла завершения установки. <a href="?step=4&file=1">Повторить попытку</a></h3>';
         }
     }
     raptor_print('PGgzPtCS0LLQtdC00LjRgtC1INC00LDQvdC90YvQtSDQtNC70Y8g0LLQsNGI0LXQs9C+INC40LPRgNC+0LrQsCDQuCDQv9C10YDRgdC+0L3QsNC20LA8L2gzPjxmb3JtIGFjdGlvbj0iIiBtZXRob2Q9IlBPU1QiPg0KCQk8ZGl2IGNsYXNzPSJmb3JtLWdyb3VwIj4NCgkJCTxsYWJlbD7Qm9C+0LPQuNC9INC4INC40LzRjzwvbGFiZWw+DQoJCQk8aW5wdXQgY2xhc3M9ImZvcm0tY29udHJvbCIgbmFtZT0ibmFtZSIgdmFsdWU9IiI+DQoJCTwvZGl2Pg0KCQk8ZGl2IGNsYXNzPSJmb3JtLWdyb3VwIj4NCgkJCTxsYWJlbD5FLU1BSUw8L2xhYmVsPg0KCQkJPGlucHV0IGNsYXNzPSJmb3JtLWNvbnRyb2wiIG5hbWU9ImVtYWlsIiB2YWx1ZT0iIj4NCgkJPC9kaXY+DQoJCTxkaXYgY2xhc3M9ImZvcm0tZ3JvdXAiPg0KCQkJPGxhYmVsPtCf0LDRgNC+0LvRjDwvbGFiZWw+DQoJCQk8aW5wdXQgY2xhc3M9ImZvcm0tY29udHJvbCIgbmFtZT0icGFzc3dvcmQiIHZhbHVlPSIiPg0KCQk8L2Rpdj4NCgkJPGRpdiBjbGFzcz0iZm9ybS1ncm91cCI+DQoJCQk8bGFiZWw+0JPRgNCw0YTQsCAi0J7QsdC+INC80L3QtSI8L2xhYmVsPg0KCQkJPGlucHV0IGNsYXNzPSJmb3JtLWNvbnRyb2wiIG5hbWU9ImFib3V0IiB2YWx1ZT0iIj4NCgkJPC9kaXY+DQoJCTxidXR0b24gdHlwZT0ic3VibWl0IiBjbGFzcz0iYnRuIGJ0bi1kZWZhdWx0Ij7QodC+0LfQtNCw0YLRjCDQsNC60LrQsNGD0L3RgjwvYnV0dG9uPg0KCQk8L2Zvcm0+');