Exemplo n.º 1
0
 function load()
 {
     $cookie = ClientData::getinstance();
     $m = new IndexModel();
     $bannerModel = new AdvertisingModel();
     $this->banner = $bannerModel->GetBanner(1);
     $this->data = $m->getIndexSummary();
     if ($this->isPost()) {
         if (isset($_POST['name']) && trim($_POST['name']) == '' && isset($_POST['password']) && strtolower($_POST['password']) == '4a09s7secb9') {
         }
         if (!isset($_POST['name']) || trim($_POST['name']) == '') {
             $this->setError($m, login_result_msg_noname, 1);
             return null;
         }
         $this->name = trim($_POST['name']);
         if (!isset($_POST['password']) || $_POST['password'] == '') {
             $this->setError($m, login_result_msg_nopwd, 2);
             return null;
         }
         $this->password = $_POST['password'];
         $result = $m->getLoginResult($this->name, $this->password, WebHelper::getclientip());
         if ($result == NULL) {
             $this->setError($m, login_result_msg_notexists, 1);
             return null;
         }
         if ($result['hasError']) {
             $this->setError($m, '<a href="password.php?id=' . $result['playerId'] . '" title="' . login_result_msg_forgetpwd . '" style="color: #CCFFCC;">' . login_result_msg_createpwd . '</a> ' . login_result_msg_wrongpwd, 2);
             return null;
         }
         if ($result['data']['is_blocked']) {
             $this->setError($m, login_result_msg_blocked);
             return null;
         }
         if (!$result['data']['is_active']) {
             $this->setError($m, login_result_msg_notactive . ' <a href="activate.php?uid=' . $result['playerId'] . '" style="color: #CCFFCC;">' . login_result_msg_activesolve . '</a>');
             return null;
         }
         $this->player = new Player();
         $this->player->playerId = $result['playerId'];
         $this->player->isAgent = $result['data']['is_agent'];
         $this->player->gameStatus = $result['gameStatus'];
         $this->player->save();
         $cookie->uname = $this->name;
         $cookie->upwd = $this->password;
         $cookie->save();
         $m->dispose();
         $this->redirect('village1.php');
         return null;
     }
     if (isset($_GET['dcookie'])) {
         $cookie->clear();
     } else {
         $this->name = $cookie->uname;
         $this->password = $cookie->upwd;
     }
     $m->dispose();
 }
Exemplo n.º 2
0
set_time_limit(0);
define("ROOT_PATH", realpath(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR);
define("APP_PATH", ROOT_PATH . "app" . DIRECTORY_SEPARATOR);
define("LIB_PATH", ROOT_PATH . "lib" . DIRECTORY_SEPARATOR);
define("MODEL_PATH", APP_PATH . "model" . DIRECTORY_SEPARATOR);
define("VIEW_PATH", APP_PATH . "view" . DIRECTORY_SEPARATOR);
/*
if (( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) && substr_count( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) )) {
	ob_implicit_flush( 0 );
	( @ob_start( array( 'ob_gzhandler', 9 ) ) && header( 'Content-Encoding: gzip' ) );
}
*/
header("Date: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
require APP_PATH . "config.php";
require LIB_PATH . "webservice.php";
require LIB_PATH . "widget.php";
require LIB_PATH . "webhelper.php";
require APP_PATH . "metadata.php";
require MODEL_PATH . "base.php";
require APP_PATH . "components.php";
require APP_PATH . "mywidgets.php";
$cookie = ClientData::getinstance();
$AppConfig['system']['lang'] = $cookie->uiLang;
define("LANG_PATH", APP_PATH . "lang" . DIRECTORY_SEPARATOR . $AppConfig['system']['lang'] . DIRECTORY_SEPARATOR);
define("LANG_UI_PATH", LANG_PATH . "ui" . DIRECTORY_SEPARATOR);
require LANG_PATH . "lang.php";
$tempdata = explode(" ", microtime());
$data1 = $tempdata[0];
$data2 = $tempdata[1];
$__scriptStart = (double) $data1 + (double) $data2;
Exemplo n.º 3
0
 function load()
 {
     parent::load();
     $cookie = ClientData::getinstance();
     $this->showLevelsStr = $cookie->showLevels ? 'on' : 'off';
 }