本文整理汇总了PHP中iPHP::seccode方法的典型用法代码示例。如果您正苦于以下问题:PHP iPHP::seccode方法的具体用法?PHP iPHP::seccode怎么用?PHP iPHP::seccode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iPHP
的用法示例。
在下文中一共展示了iPHP::seccode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_seccode
public static function check_seccode()
{
if ($_POST['username'] && $_POST['password']) {
$seccode = iS::escapeStr($_POST['iACP_seccode']);
iPHP::seccode($seccode, true, 'iACP_seccode') or iPHP::code(0, 'iCMS:seccode:error', 'seccode', 'json');
}
}
示例2: ACTION_add
public function ACTION_add()
{
if (!iCMS::$config['comment']['enable']) {
iPHP::code(0, 'iCMS:comment:close', 0, 'json');
}
iPHP::app('user.class', 'static');
user::get_cookie() or iPHP::code(0, 'iCMS:!login', 0, 'json');
$seccode = iS::escapeStr($_POST['seccode']);
if (iCMS::$config['comment']['seccode']) {
iPHP::seccode($seccode, true) or iPHP::code(0, 'iCMS:seccode:error', 'seccode', 'json');
}
iPHP::app('user.msg.class', 'static');
$appid = (int) $_POST['appid'];
$iid = (int) $_POST['iid'];
$cid = (int) $_POST['cid'];
$suid = (int) $_POST['suid'];
$reply_id = (int) $_POST['id'];
$reply_uid = (int) $_POST['userid'];
$reply_name = iS::escapeStr($_POST['name']);
$title = iS::escapeStr($_POST['title']);
$content = iS::escapeStr($_POST['content']);
$iid or iPHP::code(0, 'iCMS:article:empty_id', 0, 'json');
$content or iPHP::code(0, 'iCMS:comment:empty', 0, 'json');
$fwd = iCMS::filter($content);
$fwd && iPHP::code(0, 'iCMS:comment:filter', 0, 'json');
$appid or $appid = iCMS_APP_ARTICLE;
$addtime = $_SERVER['REQUEST_TIME'];
$ip = iPHP::getIp();
$userid = user::$userid;
$username = user::$nickname;
$status = iCMS::$config['comment']['examine'] ? '0' : '1';
$up = '0';
$down = '0';
$quote = '0';
$floor = '0';
$fields = array('appid', 'cid', 'iid', 'suid', 'title', 'userid', 'username', 'content', 'reply_id', 'reply_uid', 'reply_name', 'addtime', 'status', 'up', 'down', 'ip', 'quote', 'floor');
$data = compact($fields);
$id = iDB::insert('comment', $data);
iDB::query("UPDATE `#iCMS@__article` SET comments=comments+1 WHERE `id` ='{$iid}' limit 1");
user::update_count($userid, 1, 'comments');
if (iCMS::$config['comment']['examine']) {
iPHP::code(0, 'iCMS:comment:examine', $id, 'json');
}
iPHP::code(1, 'iCMS:comment:success', $id, 'json');
}
示例3: API_check
public function API_check()
{
$name = iS::escapeStr($_GET['name']);
$value = iS::escapeStr($_GET['value']);
$a = iPHP::code(1, '', $name);
switch ($name) {
case 'username':
if (!preg_match("/^[\\w\\-\\.]+@[\\w\\-]+(\\.\\w+)+\$/i", $value)) {
$a = iPHP::code(0, 'user:register:username:error', 'username');
} else {
user::check($value, 'username') && ($a = iPHP::code(0, 'user:register:username:exist', 'username'));
}
break;
case 'nickname':
if (preg_match("/\\d/", $value[0]) || cstrlen($value) > 20 || cstrlen($value) < 4) {
$a = iPHP::code(0, 'user:register:nickname:error', 'nickname');
} else {
user::check($value, 'nickname') && ($a = iPHP::code(0, 'user:register:nickname:exist', 'nickname'));
}
break;
case 'password':
strlen($value) < 6 && ($a = iPHP::code(0, 'user:password:error', 'password'));
break;
case 'seccode':
iPHP::seccode($value) or $a = iPHP::code(0, 'iCMS:seccode:error', 'seccode');
break;
}
iPHP::json($a);
}