public function preform()
 {
     $DaoUser = new DaoAdminUser();
     $ret = $DaoUser->getAdminUserInfoByUsernameAndPassWord($this->params['safe']['admin_name'], $this->params['safe']['admin_password']);
     print_r($ret);
     if (empty($ret)) {
         throw new Exception('error_login', 1);
     }
     $this->result['data'] = $ret[0];
 }
Example #2
0
<?php

$type = isset($_GET['type']) ? $_GET['type'] : 'none';
$adminName = !empty($_GET['adminName']) ? $_GET['adminName'] : '';
$code = !empty($_GET['code']) ? $_GET['code'] : '';
require_once '../Dao/DaoAdminUser.class.php';
session_start();
if ($type == 'none') {
    echo "这是一个空白页面!";
} elseif ($type == 'adminUser') {
    $DaoAdminUser = new DaoAdminUser();
    $result = $DaoAdminUser->getAdminUserByName($adminName);
    echo $result;
} elseif ($type == 'adminCode') {
    if ($_SESSION['admincode'] == $code) {
        echo '1';
    } else {
        echo '0';
    }
}