本文整理汇总了PHP中member::checklogin方法的典型用法代码示例。如果您正苦于以下问题:PHP member::checklogin方法的具体用法?PHP member::checklogin怎么用?PHP member::checklogin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类member
的用法示例。
在下文中一共展示了member::checklogin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ckseccode
case 'logout':
member::cleancookie();
break;
default:
require_once iPATH . 'include/UI.class.php';
$action = $_POST['action'];
//$forward= $_POST['forward'];
if ($action == 'register') {
ckseccode($_POST['seccode'], 'U') && javascript::json('seccode', 'error:seccode');
$username = dhtmlspecialchars($_POST['username']);
!preg_match("/^([\\w\\.-]+)@([a-zA-Z0-9-]+)(\\.[a-zA-Z\\.]+)\$/i", $username) && javascript::json('username', 'register:emailerror');
iCMS_DB::getValue("SELECT uid FROM `#iCMS@__members` where `username`='{$username}'") && javascript::json('username', 'register:emailusr');
$password = md5(trim($_POST['password']));
$pwdrepeat = md5(trim($_POST['pwdrepeat']));
$password != $pwdrepeat && javascript::json('pwdrepeat', 'register:different');
$nickname = dhtmlspecialchars($_POST['nickname']);
cstrlen($nickname) > 12 && javascript::json(0, 'register:nicknamelong');
iCMS_DB::query("INSERT INTO `#iCMS@__members` (`groupid`,`username`,`password`,`nickname`,`gender`,`info`,`power`,`cpower`,`regtime`,`lastip`,`lastlogintime`,`logintimes`,`post`,`type`,`status`) VALUES ('4','{$username}','{$password}', '{$nickname}','2','','','','" . time() . "','" . getip() . "', '" . time() . "','0','0','0','1') ");
$uid = iCMS_DB::$insert_id;
//设置为登陆状态
member::set_user_cookie($username, $password, $nickname);
javascript::json(1, 'register:finish');
} elseif ($action == "login") {
ckseccode($_POST['seccode'], 'U') && javascript::json(0, 'error:seccode');
if (member::checklogin(true)) {
javascript::json(1, 'login:success');
} else {
javascript::json(0, 'login:failed');
}
}
}
示例2: define
*/
/*************设置public目录路径**************/
/** ../ 表示global.php文件位于上层目录 */
define('iCMSPATH', '../');
/*********************************************/
/*********************************************/
require_once dirname(__FILE__) . '/' . iCMSPATH . 'global.php';
define('uPATH', dirname(strtr(__FILE__, '\\', '/')) . "/");
define('__USERCP__', __SELF__ . '?mo');
require_once iPATH . 'include/member.class.php';
require_once iPATH . 'admin/function.php';
require_once iPATH . 'include/UI.class.php';
if ($_POST['action'] == "login") {
ckseccode($_POST['seccode'], 'U') && javascript::alert('验证码错误!');
}
member::checklogin();
class UserCP
{
function __construct()
{
global $iCMS, $firstcount, $pagenav;
$this->iCMS =& $iCMS;
$this->pagenav =& $pagenav;
$this->firstcount =& $firstcount;
$this->uiBasePath = $iCMS->config['publicURL'] . '/ui';
$this->module = $_GET['mo'] ? $_GET['mo'] : '';
$this->action = isset($_GET['do']) ? $_GET['do'] : $_POST['do'];
$this->param = isset($_GET['param']) ? $_GET['param'] : $_POST['param'];
empty($this->action) && ($this->action = 'manage');
!isset($this->param) && ($this->param = NULL);
if (empty($this->module)) {