示例#1
0
 public static function correct(&$frm)
 {
     global $securimage;
     if ($frm->getField('username')->getValue() != ADMINNAME) {
         $frm->getField('username')->setError('Admin name Incorrect.');
     }
     if ($frm->getField('password')->getValue() != ADMINPASSWORD) {
         $frm->getField('password')->setError('Admin password Incorrect.');
     }
     if ($securimage->check($frm->getField('captcha')->getValue()) == false) {
         $frm->getField('captcha')->setError('Captcha Incorrect.');
         return false;
     } else {
         return cmAuth::login($frm->getField('username')->getValue(), $frm->getField('password')->getValue());
     }
 }
示例#2
0
        die;
    }
} elseif (defined('IN_LOGIN') && defined('IN_IMAGE')) {
} elseif (defined("IN_LOGIN") && IN_LOGIN == true) {
    reqFile(CM_ROOT . '/cm_includes/securimage/securimage.php');
    $securimage = new Securimage();
} elseif (defined("IN_ADMIN") && IN_ADMIN == true) {
    if (!cmAuth::is_logined()) {
        header('Location: ' . CM_URL . '/cm_admin/login.php');
    }
} elseif (defined('IN_IMAGE') && IN_IMAGE == true) {
    if (!cmAuth::is_logined()) {
        die;
    }
} else {
    if (!cmAuth::is_logined()) {
        header('Location: ' . CM_URL . '/login.php');
    }
}
//load SpoonMysql
if (defined('LOAD_MYSQL')) {
    $mysql = new SpoonDatabase('mysql', MYSQL_HOST, MYSQL_UN, MYSQL_PW, MYSQL_DB);
    reqFile(CM_ROOT . '/cm_includes/mysql.php');
}
//load SpoonTemplate
if (defined('LOAD_TEMPLATE')) {
    $tpl = reqFile(CM_ROOT . '/cm_includes/template.php');
}
//load Form Functions
if (defined('LOAD_FORM')) {
    reqFile(CM_ROOT . '/cm_includes/form.php');