• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_user_auth函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_user_auth函数的典型用法代码示例。如果您正苦于以下问题:PHP get_user_auth函数的具体用法?PHP get_user_auth怎么用?PHP get_user_auth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_user_auth函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: can_process

function can_process()
{
    $Auth_Result = hook_authenticate($_SESSION["wa_current_user"]->username, $_POST['cur_password']);
    if (!isset($Auth_Result)) {
        // if not used external login: standard method
        $Auth_Result = get_user_auth($_SESSION["wa_current_user"]->username, md5($_POST['cur_password']));
    }
    if (!$Auth_Result) {
        display_error(_("Invalid password entered."));
        set_focus('cur_password');
        return false;
    }
    if (strlen($_POST['password']) < 4) {
        display_error(_("The password entered must be at least 4 characters long."));
        set_focus('password');
        return false;
    }
    if (strstr($_POST['password'], $_SESSION["wa_current_user"]->username) != false) {
        display_error(_("The password cannot contain the user login."));
        set_focus('password');
        return false;
    }
    if ($_POST['password'] != $_POST['passwordConfirm']) {
        display_error(_("The passwords entered are not the same."));
        set_focus('password');
        return false;
    }
    return true;
}
开发者ID:M-Shahbaz,项目名称:FA,代码行数:29,代码来源:change_current_user_password.php


示例2: index

 public function index()
 {
     $GLOBALS['tmpl']->caching = true;
     $GLOBALS['tmpl']->cache_lifetime = 600;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['id']) . intval($_REQUEST['p']));
     if (!$GLOBALS['tmpl']->is_cached('page/space_index.html', $cache_id)) {
         $this->init();
         $title = sprintf($GLOBALS['lang']['WHOS_SPACE'], $this->space_user['user_name']);
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/");
         $site_nav[] = array('name' => $title, 'url' => url("index", "space", array("id" => $this->space_user['id'])));
         $site_nav[] = array('name' => $GLOBALS['lang']['SPACE_HOME'], 'url' => url("index", "space", array("id" => $this->space_user['id'])));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         $GLOBALS['tmpl']->assign("page_title", $title);
         $GLOBALS['tmpl']->assign("page_keyword", $title . ",");
         $GLOBALS['tmpl']->assign("page_description", $title . ",");
         //输出发言列表
         $page = intval($_REQUEST['p']);
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_topic_list($limit, " (user_id = " . $this->space_user['id'] . " OR (fav_id = " . $this->space_user['id'] . " AND type='focus') OR (l_user_id =" . $this->space_user['id'] . " AND type='message' )) ");
         $GLOBALS['tmpl']->assign("topic_list", $result['list']);
         $page = new Page($result['total'], app_conf("PAGE_SIZE"));
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         $list_html = $GLOBALS['tmpl']->fetch("inc/topic_col_list.html");
         $GLOBALS['tmpl']->assign("list_html", $list_html);
         $GLOBALS['tmpl']->assign('user_auth', get_user_auth());
     }
     $GLOBALS['tmpl']->display("page/space_index.html", $cache_id);
 }
开发者ID:workplayteam,项目名称:P2P,代码行数:33,代码来源:spaceModule.class.php


示例3: index

 public function index()
 {
     global $tmpl;
     $rel_table = addslashes(trim($_REQUEST['act']));
     $message_type = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "message_type where type_name='" . $rel_table . "' and type_name <> 'supplier'");
     if (!$message_type || $message_type['is_fix'] == 0) {
         app_redirect(APP_ROOT . "/");
     }
     $rel_table = $message_type['type_name'];
     $condition = '';
     $id = intval($_REQUEST['id']);
     if ($rel_table == 'deal') {
         $deal = get_deal($id);
         if ($deal['buy_type'] != 1) {
             $GLOBALS['tmpl']->assign("deal", $deal);
         }
         $id = $deal['id'];
     }
     require APP_ROOT_PATH . 'app/Lib/side.php';
     if ($id > 0) {
         $condition = "rel_table = '" . $rel_table . "' and rel_id = " . $id;
     } else {
         $condition = "rel_table = '" . $rel_table . "'";
     }
     if (app_conf("USER_MESSAGE_AUTO_EFFECT") == 0) {
         $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']);
     } else {
         if ($message_type['is_effect'] == 0) {
             $condition .= " and user_id = " . intval($GLOBALS['user_info']['id']);
         }
     }
     $condition .= " and is_buy = " . intval($_REQUEST['is_buy']);
     //message_form 变量输出
     $GLOBALS['tmpl']->assign("post_title", $message_type['show_name']);
     $GLOBALS['tmpl']->assign("page_title", $message_type['show_name']);
     $GLOBALS['tmpl']->assign('rel_id', $id);
     $GLOBALS['tmpl']->assign('rel_table', $rel_table);
     $GLOBALS['tmpl']->assign('is_buy', intval($_REQUEST['is_buy']));
     if (intval($_REQUEST['is_buy']) == 1) {
         $GLOBALS['tmpl']->assign("post_title", $GLOBALS['lang']['AFTER_BUY']);
         $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['AFTER_BUY']);
     }
     if (!$GLOBALS['user_info']) {
         $GLOBALS['tmpl']->assign("message_login_tip", sprintf($GLOBALS['lang']['MESSAGE_LOGIN_TIP'], url("shop", "user#login"), url("shop", "user#register")));
     }
     //分页
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $message = get_message_list($limit, $condition);
     $page = new Page($message['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("message_list", $message['list']);
     $GLOBALS['tmpl']->assign("user_auth", get_user_auth());
     $GLOBALS['tmpl']->display("message.html");
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:60,代码来源:messageModule.class.php


示例4: init_user_info

 private static function init_user_info()
 {
     $userinit = get_user_auth();
     if (empty($userinit['id'])) {
         //注册用户
         $userinit = empty(self::$weixin_post['fromusername']) ? wx_error('Sorry!用户标识为空') : register_weixin(true, self::$weixin_post['fromusername']);
     }
     //用户关注状态
     if (empty($userinit['follow'])) {
         change_user_follow($userinit['fromusername']);
     }
     //注册用户昵称
     if (preg_match("/^我叫/", self::$weixin_post['content'])) {
         $str = str_replace(" ", '', self::$weixin_post['content']);
         $nickname = str_replace('我叫', '', $str);
         set_nickname(self::$weixin_post['fromusername'], $nickname);
     }
     //强制绑定昵称
     if (empty($userinit['nickname'])) {
         wx_success('发送“我叫”+您的昵称,交朋友更方便哦~');
     }
     if ($userinit['status'] == 0) {
         wx_error('Sorry!您的账号已被冻结,请联系管理员......');
     }
     if ($userinit['followercate_status'] == 0) {
         wx_error('Sorry!您所在的用户组【' . $userinit['followercate_title'] . '】已被冻结,请联系管理员......');
     }
     /*用户资料初始化*/
     global $_P;
     $_P = $userinit;
 }
开发者ID:Luckyseal,项目名称:amango,代码行数:31,代码来源:WeixinInitBehavior.class.php


示例5: index

 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $id = intval($_REQUEST['id']);
     require_once APP_ROOT_PATH . 'system/model/topic.php';
     $topic = get_topic_item($id);
     if ($id > 0 && !empty($topic)) {
         //
     } else {
         app_redirect(url("index"));
     }
     if ($topic['group_id'] > 0) {
         $GLOBALS['tmpl']->assign('topic_group', get_topic_group($topic['group_id']));
     }
     $title = $topic['forum_title'];
     $content = decode_topic($topic['content']);
     $is_fav = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic where  (fav_id = " . $id . " or (origin_id = " . $id . " and fav_id <> 0))  and user_id = " . intval($GLOBALS['user_info']['id']));
     $GLOBALS['tmpl']->assign("topic", $topic);
     $GLOBALS['tmpl']->assign("title", $title);
     $GLOBALS['tmpl']->assign("content", $content);
     $GLOBALS['tmpl']->assign("is_fav", $is_fav);
     $GLOBALS['tmpl']->assign("page_title", $title);
     $GLOBALS['tmpl']->assign("page_keyword", $title . ",");
     $GLOBALS['tmpl']->assign("page_description", $title . ",");
     $GLOBALS['tmpl']->assign('user_auth', get_user_auth());
     $GLOBALS['tmpl']->display("topic_index.html");
 }
开发者ID:macall,项目名称:jsd,代码行数:30,代码来源:topicModule.class.php


示例6: user_auth_type2str

/**
 * Get user authentication name.
 *
 * @param int $authType
 *
 * @return string
 */
function user_auth_type2str($authType)
{
    if ($authType === null) {
        $authType = get_user_auth(CWebUser::$data['userid']);
    }
    $authUserType = array(GROUP_GUI_ACCESS_SYSTEM => _('System default'), GROUP_GUI_ACCESS_INTERNAL => _x('Internal', 'user type'), GROUP_GUI_ACCESS_DISABLED => _('Disabled'));
    return isset($authUserType[$authType]) ? $authUserType[$authType] : _('Unknown');
}
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:15,代码来源:users.inc.php


示例7: init_main

 public function init_main()
 {
     //		$user_info = $GLOBALS['db']->getRow("select * from ".DB_PREFIX."user where id = ".intval($GLOBALS['user_info']['id']));
     //		require_once APP_ROOT_PATH."system/extend/ip.php";
     //		$iplocation = new iplocate();
     //		$address=$iplocation->getaddress($user_info['login_ip']);
     //		$user_info['from'] = $address['area1'].$address['area2'];
     $GLOBALS['tmpl']->assign('user_auth', get_user_auth());
 }
开发者ID:norain2050,项目名称:fanwei_xindai_3.2,代码行数:9,代码来源:uc_centerModule.class.php


示例8: user_auth_type2str

function user_auth_type2str($auth_type)
{
    if (is_null($auth_type)) {
        $auth_type = get_user_auth(CWebUser::$data['userid']);
    }
    $auth_user_type[GROUP_GUI_ACCESS_SYSTEM] = _('System default');
    $auth_user_type[GROUP_GUI_ACCESS_INTERNAL] = _('Internal');
    $auth_user_type[GROUP_GUI_ACCESS_DISABLED] = _('Disabled');
    if (isset($auth_user_type[$auth_type])) {
        return $auth_user_type[$auth_type];
    }
    return _('Unknown');
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:13,代码来源:users.inc.php


示例9: user_auth_type2str

function user_auth_type2str($auth_type)
{
    if (is_null($auth_type)) {
        global $USER_DETAILS;
        $auth_type = get_user_auth($USER_DETAILS['userid']);
    }
    $auth_user_type[GROUP_GUI_ACCESS_SYSTEM] = S_SYSTEM_DEFAULT;
    $auth_user_type[GROUP_GUI_ACCESS_INTERNAL] = S_INTERNAL_S;
    $auth_user_type[GROUP_GUI_ACCESS_DISABLED] = S_DISABLED;
    if (isset($auth_user_type[$auth_type])) {
        return $auth_user_type[$auth_type];
    }
    return S_UNKNOWN;
}
开发者ID:phedders,项目名称:zabbix,代码行数:14,代码来源:users.inc.php


示例10: forum

 public function forum()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $group_id = intval($_REQUEST['id']);
     $group_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "topic_group where is_effect = 1 and id = " . $group_id);
     if (!$group_item) {
         showErr("不存在的小组");
     }
     $GLOBALS['tmpl']->assign("group_info", $group_item);
     $title = $group_item['name'];
     $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
     $site_nav[] = array('name' => $GLOBALS['lang']['GROUP_FORUM'], 'url' => url("index", "group"));
     $site_nav[] = array('name' => $title, 'url' => url("index", "group#forum", array("id" => $group_id)));
     $GLOBALS['tmpl']->assign("site_nav", $site_nav);
     $GLOBALS['tmpl']->assign("page_title", $title);
     $GLOBALS['tmpl']->assign("page_keyword", $title . ",");
     $GLOBALS['tmpl']->assign("page_description", $title . ",");
     //输出是否加入组
     $user_id = intval($GLOBALS['user_info']['id']);
     if ($user_id == 0) {
         $is_join = 0;
     } else {
         $is_admin = 0;
         if ($group_item['user_id'] == $user_id) {
             $is_admin = 1;
         }
         if ($is_admin == 0) {
             $join_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_topic_group where user_id = " . $user_id . " and group_id = " . $group_item['id']);
             if ($join_data) {
                 $is_join = 1;
                 $is_admin = $join_data['type'];
             } else {
                 $is_join = 0;
             }
         } else {
             $is_join = 1;
         }
     }
     $GLOBALS['tmpl']->assign('is_join', $is_join);
     $GLOBALS['tmpl']->assign('is_admin', $is_admin);
     //输出列表
     $page_size = app_conf("PAGE_SIZE");
     $page = intval($_REQUEST['p']);
     if ($page <= 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $condition = " group_id = " . $group_item['id'];
     $sortby = "is_top desc,create_time desc";
     $sortkey = "ordery_sort";
     $filter = intval($_REQUEST['filter']);
     //0全部 1推荐
     $sort = intval($_REQUEST['sort']);
     //0创建时间 1回复时间
     $url_param = array("filter" => $filter, "sort" => $sort, "p" => $page, "id" => $group_id);
     if ($filter == 1) {
         $condition .= " and is_best = 1 ";
     }
     if ($sort == 1) {
         $sortby = " is_top desc,last_time desc ";
         $sortkey = "last_time_sort";
     }
     $tmp_url_param = $url_param;
     $tmp_url_param['filter'] = 0;
     $urls['all'] = url("index", "group#forum", $tmp_url_param);
     $tmp_url_param = $url_param;
     $tmp_url_param['filter'] = 1;
     $urls['is_best'] = url("index", "group#forum", $tmp_url_param);
     $tmp_url_param = $url_param;
     $tmp_url_param['sort'] = 0;
     $urls['create_time'] = url("index", "group#forum", $tmp_url_param);
     $tmp_url_param = $url_param;
     $tmp_url_param['sort'] = 1;
     $urls['last_time'] = url("index", "group#forum", $tmp_url_param);
     $GLOBALS['tmpl']->assign("urls", $urls);
     //		$sql = "select * from ".DB_PREFIX."topic use index($sortkey) where is_effect = 1 and is_delete = 0  $condition order by $sortby limit ".$limit;
     //		$sql_count = "select count(*) from ".DB_PREFIX."topic use index($sortkey) where is_effect = 1 and is_delete = 0 $condition ";
     //		$list = $GLOBALS['db']->getAll($sql);
     //		$count = $GLOBALS['db']->getOne($sql_count);
     $list = get_topic_list($limit, array("cid" => 0, "tag" => ""), "", $condition, $sortby);
     $list = $list['list'];
     $count = count($list);
     $GLOBALS['tmpl']->assign("list", $list);
     $page = new Page($count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $join_url = url("index", "group#joingroup", array("id" => $group_id));
     $exit_url = url("index", "group#exitgroup", array("id" => $group_id));
     $edit_url = url("index", "group#edit", array("id" => $group_id));
     $GLOBALS['tmpl']->assign("join_url", $join_url);
     $GLOBALS['tmpl']->assign("exit_url", $exit_url);
     $GLOBALS['tmpl']->assign("edit_url", $edit_url);
     //输出组员
     $user_list = $GLOBALS['db']->getAll("select user_id as id,type from " . DB_PREFIX . "user_topic_group where group_id = " . $group_item['id'] . " order by type desc limit 10 ");
     $GLOBALS['tmpl']->assign('user_list', $user_list);
     $GLOBALS['tmpl']->assign('user_auth', get_user_auth());
//.........这里部分代码省略.........
开发者ID:macall,项目名称:jsd,代码行数:101,代码来源:groupModule.class.php


示例11: load_topic_reply_list

 /**
  * 载入主题评论
  */
 public function load_topic_reply_list()
 {
     global_run();
     if ($GLOBALS['user_info']) {
         $GLOBALS['tmpl']->assign("user_info", $GLOBALS['user_info']);
     }
     $topic_id = $_POST['topic_id'];
     require_once APP_ROOT_PATH . 'system/model/topic.php';
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     //分页
     $page_size = 5;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $reply_list = get_topic_reply_list($topic_id, $limit);
     foreach ($reply_list as $k => $v) {
         $reply_list[$k]['content'] = decode_topic_without_img($v['content']);
     }
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "topic_reply where is_effect=1 and is_delete=0 and topic_id=" . $topic_id);
     $page = new Page($total, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign('reply_list', $reply_list);
     $GLOBALS['tmpl']->assign('user_auth', get_user_auth());
     $data['html'] = $GLOBALS['tmpl']->fetch("inc/topic_reply_list.html");
     ajax_return($data);
 }
开发者ID:macall,项目名称:jsd,代码行数:33,代码来源:ajaxModule.class.php


示例12: CCombobox

 $frmAuth->addVar('form_refresh_ldap', $form_refresh_ldap);
 $cmbConfig = new CCombobox('config', ZBX_AUTH_LDAP, 'submit()');
 $cmbConfig->addItem(ZBX_AUTH_INTERNAL, S_INTERNAL_S);
 $cmbConfig->addItem(ZBX_AUTH_LDAP, S_LDAP);
 $cmbConfig->addItem(ZBX_AUTH_HTTP, S_HTTP);
 $frmAuth->addRow(S_DEFAULT_AUTHENTICATION, $cmbConfig);
 $frmAuth->addRow(S_LDAP . SPACE . S_HOST, new CTextBox('ldap_host', $config['ldap_host'], 64));
 $frmAuth->addRow(S_PORT, new CNumericBox('ldap_port', $config['ldap_port'], 5));
 $frmAuth->addRow(S_BASE_DN, new CTextBox('ldap_base_dn', $config['ldap_base_dn'], 64));
 $frmAuth->addRow(S_SEARCH_ATTRIBUTE, new CTextBox('ldap_search_attribute', empty($config['ldap_search_attribute']) ? 'uid' : $config['ldap_search_attribute']));
 $frmAuth->addRow(S_BIND_DN . '*', new CTextBox('ldap_bind_dn', $config['ldap_bind_dn'], 64));
 $frmAuth->addRow(S_BIND_PASSWORD . '*', new CPassBox('ldap_bind_password', $config['ldap_bind_password']));
 $action = "javascript: if(confirm('" . S_SWITCHING_LDAP . "')) return true; else return false;";
 $frmAuth->addRow(S_LDAP . SPACE . S_AUTHENTICATION . SPACE . S_ENABLED, new CCheckBox('authentication_type', $config['authentication_type'], $action, ZBX_AUTH_LDAP));
 $frmAuth->addRow(S_TEST . SPACE . S_AUTHENTICATION, ' [' . S_MUST_BE_VALID_SMALL . SPACE . S_LDAP . SPACE . S_USER . ']');
 if (GROUP_GUI_ACCESS_INTERNAL == get_user_auth($USER_DETAILS['userid'])) {
     $usr_test = new CComboBox('user', $USER_DETAILS['alias']);
     $sql = 'SELECT u.alias, u.userid ' . ' FROM users u ' . ' WHERE ' . DBin_node('u.userid') . ' ORDER BY alias ASC';
     $u_res = DBselect($sql);
     while ($db_user = Dbfetch($u_res)) {
         if (check_perm2login($db_user['userid']) && check_perm2system($db_user['userid'])) {
             $usr_test->addItem($db_user['alias'], $db_user['alias']);
         }
     }
 } else {
     $usr_test = new CTextBox('user', $USER_DETAILS['alias'], null, 'yes');
 }
 $frmAuth->addRow(S_LOGIN, $usr_test);
 $frmAuth->addRow(S_USER . SPACE . S_PASSWORD, new CPassBox('user_password'));
 $frmAuth->addItemToBottomRow(new CButton('save', S_SAVE));
 $frmAuth->addItemToBottomRow(new CButton('test', S_TEST));
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:authentication.php


示例13: search


//.........这里部分代码省略.........
     }
     $condition = " 1=1 ";
     if ($type == 0) {
         //所有分享
         $condition .= "";
         $search_title = $GLOBALS['lang']['TOPIC_TYPE_ALL'];
     } elseif ($type == 1) {
         $condition .= " and (t.type='tuancomment' or t.type='shopcomment' or t.type='youhuicomment' ) ";
         $search_title = $GLOBALS['lang']['TOPIC_TYPE_DEAL'];
     } elseif ($type == 2) {
         $condition .= " and t.type='slocationcomment' ";
         $search_title = $GLOBALS['lang']['TOPIC_TYPE_STORE'];
     } elseif ($type == 3) {
         $condition .= " and t.title like '" . $keyword . "' ";
         $search_title = $GLOBALS['lang']['TOPIC_TYPE_RECOMMEND'];
     }
     if ($filter == 0) {
         //全部
         //$search_title.= " - ".$GLOBALS['lang']['TOPIC_FILTER_ALL'];
     } elseif ($filter == 1) {
         $search_title .= " - " . $GLOBALS['lang']['TOPIC_FILTER_MYFOCUS'];
         $condition .= " and uf.focus_user_id =  " . intval($GLOBALS['user_info']['id']);
     } elseif ($filter == 2) {
         $search_title .= " - " . $GLOBALS['lang']['TOPIC_FILTER_DAREN'];
         $condition .= " and u.is_daren = 1 ";
     } elseif ($filter == 3) {
         $search_title .= " - " . $GLOBALS['lang']['TOPIC_FILTER_MERCHANT'];
         $condition .= " and u.is_merchant = 1 ";
     }
     if ($keyword) {
         $search_title .= " - " . $keyword;
         $kws_div = div_str($keyword);
         foreach ($kws_div as $k => $item) {
             $kw[$k] = str_to_unicode_string($item);
         }
         $ukeyword = implode(" ", $kw);
         $condition .= " and match(t.keyword_match) against('" . $ukeyword . "'  IN BOOLEAN MODE) ";
     }
     $GLOBALS['tmpl']->assign("kws_div", $kws_div);
     $GLOBALS['tmpl']->assign("page_title", $search_title);
     $GLOBALS['tmpl']->assign("page_keyword", $search_title . ",");
     $GLOBALS['tmpl']->assign("page_description", $search_title . ",");
     //分页
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     //		$result = get_topic_list($limit,$condition,"",$kws_div);
     $orderby = 't.create_time desc';
     $condition = " and " . $condition;
     $list = $GLOBALS['db']->getAll("select t.* from " . DB_PREFIX . "topic as t left join " . DB_PREFIX . "user as u on t.user_id = u.id left join " . DB_PREFIX . "user_focus as uf on uf.focused_user_id = t.user_id where t.is_effect = 1 and t.is_delete = 0 " . $condition . " group by t.id order by " . $orderby . " limit " . $limit);
     $total = $GLOBALS['db']->getOne("select count(distinct(t.id)) from " . DB_PREFIX . "topic as t left join " . DB_PREFIX . "user as u on t.user_id = u.id left join " . DB_PREFIX . "user_focus as uf on uf.focused_user_id = t.user_id where t.is_effect = 1 and t.is_delete = 0  " . $condition);
     foreach ($list as $k => $v) {
         $list[$k] = get_topic_item($v, $kws_div);
         if (msubstr(preg_replace("/<[^>]+>/i", "", $list[$k]['content']), 0, 50) != preg_replace("/<[^>]+>/i", "", $list[$k]['content'])) {
             $list[$k]['short_content'] = msubstr(preg_replace("/<[^>]+>/i", "", $list[$k]['content']), 0, 50);
         } else {
             $list[$k]['short_content'] = preg_replace("/<br[^>]+>/i", "", $list[$k]['content']);
         }
         if ($list[$k]['origin']) {
             if (msubstr(preg_replace("/<[^>]+>/i", "", $list[$k]['origin']['content']), 0, 50) != preg_replace("/<[^>]+>/i", "", $list[$k]['origin']['content'])) {
                 $list[$k]['origin']['short_content'] = msubstr(preg_replace("/<[^>]+>/i", "", $list[$k]['origin']['content']), 0, 50);
             } else {
                 $list[$k]['origin']['short_content'] = preg_replace("/<br[^>]+>/i", "", $list[$k]['origin']['content']);
             }
         }
     }
     $result = array('list' => $list, 'total' => $total);
     if ($result['total'] > 0) {
         if (check_ipop_limit(get_client_ip(), "topic_search", 10, $keyword)) {
             $GLOBALS['db']->query("update " . DB_PREFIX . "topic_tag set count = count + 1 where name = '" . $keyword . "'");
         }
     }
     //$result['list'] = div_to_col($result['list']);
     $GLOBALS['tmpl']->assign("topic_list", $result['list']);
     $page = new Page($result['total'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign('user_auth', get_user_auth());
     $list_html = load_topic_list();
     //$list_html = decode_topic_without_img($GLOBALS['tmpl']->fetch("inc/topic_col_list.html"));
     $GLOBALS['tmpl']->assign("list_html", $list_html);
     $GLOBALS['tmpl']->assign("type_navs", $type_navs);
     $GLOBALS['tmpl']->assign("filter_navs", $filter_navs);
     $res = load_dynamic_cache("topic_search_hot");
     if ($res === false) {
         $res['hot_tag_list'] = $GLOBALS['db']->getAll("select name,color from " . DB_PREFIX . "topic_tag where is_recommend = 1 order by sort desc, count desc limit 10");
         $res['hot_title_list'] = $GLOBALS['db']->getAll("select name,color from " . DB_PREFIX . "topic_title where is_recommend = 1 order by sort desc,count desc limit 10");
         set_dynamic_cache("topic_search_hot", $res);
     }
     //输出搜索热词
     $GLOBALS['tmpl']->assign("hot_tag_list", $res['hot_tag_list']);
     $GLOBALS['tmpl']->assign("hot_title_list", $res['hot_title_list']);
     //输出推荐分享
     $recommend_topic = load_auto_cache("recommend_uc_topic");
     $GLOBALS['tmpl']->assign("recommend_topic", $recommend_topic);
     $GLOBALS['tmpl']->display("topic_search.html");
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:101,代码来源:topicModule.class.php


示例14: insert_load_comment

function insert_load_comment($param)
{
    require_once APP_ROOT_PATH . "app/Lib/message.php";
    require_once APP_ROOT_PATH . 'app/Lib/page.php';
    $rel_id = intval($_REQUEST['id']);
    //关联数据的ID
    $rel_table = $param['rel_table'];
    $is_effect = $param['is_effect'];
    $is_image = $param['is_image'];
    $width = $param['width'];
    $height = $param['height'];
    $GLOBALS['tmpl']->assign("height", $height);
    $GLOBALS['tmpl']->assign("width", $width);
    $GLOBALS['tmpl']->assign("rel_id", $rel_id);
    $GLOBALS['tmpl']->assign("rel_table", $rel_table);
    $GLOBALS['tmpl']->assign("is_effect", $is_effect);
    $GLOBALS['tmpl']->assign("is_image", $is_image);
    //分页
    $page = intval($_REQUEST['p']);
    if ($page == 0) {
        $page = 1;
    }
    $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
    $result = get_message_list_shop($limit, " rel_table='" . $rel_table . "' and rel_id = " . $rel_id . " and is_effect = 1");
    $GLOBALS['tmpl']->assign("message_list", $result['list']);
    $page = new Page($result['count'], app_conf("PAGE_SIZE"));
    //初始化分页对象
    $p = $page->show();
    $GLOBALS['tmpl']->assign('pages', $p);
    $GLOBALS['tmpl']->assign("user_auth", get_user_auth());
    if (!$GLOBALS['user_info']) {
        $GLOBALS['tmpl']->assign("message_login_tip", sprintf($GLOBALS['lang']['MESSAGE_LOGIN_TIP'], url("shop", "user#login"), url("shop", "user#register")));
    }
    return $GLOBALS['tmpl']->fetch("inc/inc_comment_list.html");
}
开发者ID:eliu03,项目名称:fanweP2P,代码行数:35,代码来源:insert_libs.php


示例15: get_request

 $passwd = get_request('password', '');
 $password = md5($passwd);
 $sql = 'SELECT u.userid,u.attempt_failed, u.attempt_clock, u.attempt_ip ' . ' FROM users u ' . ' WHERE u.alias=' . zbx_dbstr($name);
 //SQL to BLOCK attempts
 //					.' AND ( attempt_failed<'.ZBX_LOGIN_ATTEMPTS.
 //							' OR (attempt_failed>'.(ZBX_LOGIN_ATTEMPTS-1).
 //									' AND ('.time().'-attempt_clock)>'.ZBX_LOGIN_BLOCK.'))';
 $login = $attempt = DBfetch(DBselect($sql));
 if ($name != ZBX_GUEST_USER && zbx_empty($passwd)) {
     $login = $attempt = false;
 }
 if ($login) {
     if ($login['attempt_failed'] >= ZBX_LOGIN_ATTEMPTS) {
         sleep(ZBX_LOGIN_BLOCK);
     }
     switch (get_user_auth($login['userid'])) {
         case GROUP_GUI_ACCESS_INTERNAL:
             $authentication_type = ZBX_AUTH_INTERNAL;
             break;
         case GROUP_GUI_ACCESS_SYSTEM:
         case GROUP_GUI_ACCESS_DISABLED:
         default:
             break;
     }
     switch ($authentication_type) {
         case ZBX_AUTH_LDAP:
             $login = ldap_authentication($name, get_request('password', ''));
             break;
         case ZBX_AUTH_HTTP:
             $login = true;
             break;
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:index.php


示例16: load_topic

 public function load_topic()
 {
     $GLOBALS['tmpl']->assign('user_auth', get_user_auth());
     $cid = intval($_REQUEST['cid']);
     $tag = addslashes(htmlspecialchars(trim($_REQUEST['tag'])));
     $page = intval($_REQUEST['page']);
     if ($page == 0) {
         $page = 1;
     }
     $step = intval($_REQUEST['step']);
     $step_size = intval($_REQUEST['step_size']);
     $limit = ($page - 1) * PAGE_SIZE + ($step - 1) * SECTOR . "," . SECTOR;
     if ($step == 0 || $step > $step_size) {
         //超出
         $result['doms'] = array();
         $result['step'] = 0;
         $result['status'] = 0;
         $result['info'] = 'end';
         ajax_return($result);
     }
     if ($cid > 0) {
         $cate_name = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "topic_tag_cate where id = " . $cid);
         if ($cate_name) {
             $unicode_cate_name = str_to_unicode_string($cate_name);
             $condition .= " and match(cate_match) against('" . $unicode_cate_name . "'  IN BOOLEAN MODE) ";
         }
     }
     if ($tag != "") {
         $unicode_tag = str_to_unicode_string($tag);
         $condition .= " and match(keyword_match) against('" . $unicode_tag . "'  IN BOOLEAN MODE) ";
     }
     $sql = "select * from " . DB_PREFIX . "topic where is_effect = 1 and is_delete = 0  and fav_id = 0 and relay_id = 0 and type in ('share','sharetuan','sharegoods','sharefyouhui','sharebyouhui','shareevent') " . $condition . " order by create_time desc limit " . $limit;
     $result_list = $GLOBALS['db']->getAll($sql);
     if ($result_list) {
         $result['doms'] = array();
         foreach ($result_list as $k => $v) {
             $topic = get_topic_item($v);
             if (msubstr(preg_replace("/<[^>]+>/i", "", $topic['content']), 0, 50) != preg_replace("/<[^>]+>/i", "", $topic['content'])) {
                 $topic['short_content'] = msubstr(preg_replace("/<[^>]+>/i", "", $topic['content']), 0, 50);
             } else {
                 $topic['short_content'] = preg_replace("/<br[^>]+>/i", "", $topic['content']);
             }
             if ($topic['origin']) {
                 if (msubstr(preg_replace("/<[^>]+>/i", "", $topic['origin']['content']), 0, 50) != preg_replace("/<[^>]+>/i", "", $topic['origin']['content'])) {
                     $topic['origin']['short_content'] = msubstr(preg_replace("/<[^>]+>/i", "", $topic['origin']['content']), 0, 50);
                 } else {
                     $topic['origin']['short_content'] = preg_replace("/<br[^>]+>/i", "", $topic['origin']['content']);
                 }
             }
             $GLOBALS['tmpl']->assign("message_item", $topic);
             $result['doms'][] = decode_topic_without_img($GLOBALS['tmpl']->fetch("inc/discover_item.html"));
         }
         if ($step == 0 || $step >= $step_size) {
             //超出
             $result['step'] = 0;
             $result['status'] = 0;
             $result['info'] = 'end';
             ajax_return($result);
         } else {
             $result['status'] = 1;
             $result['step'] = $step + 1;
             $result['info'] = 'next';
             ajax_return($result);
         }
     } else {
         $result['doms'] = array();
         $result['step'] = 0;
         $result['status'] = 0;
         $result['info'] = 'end';
         //			$result['sql'] = $sql;
         ajax_return($result);
     }
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:73,代码来源:discoverModule.class.php


示例17: authenticate

 /**
  * Authenticate user
  *
  * {@source}
  * @access public
  * @static
  * @since 1.8
  * @version 1
  *
  * @param _array $user
  * @param array $user['user'] User alias
  * @param array $user['password'] User password
  * @return string session ID
  */
 public static function authenticate($user)
 {
     global $USER_DETAILS, $ZBX_LOCALNODEID;
     $name = $user['user'];
     $passwd = $user['password'];
     $auth_type = $user['auth_type'];
     $password = md5($passwd);
     $sql = 'SELECT u.userid,u.attempt_failed, u.attempt_clock, u.attempt_ip ' . ' FROM users u ' . ' WHERE u.alias=' . zbx_dbstr($name);
     //SQL to BLOCK attempts
     //					.' AND ( attempt_failed<'.ZBX_LOGIN_ATTEMPTS.
     //							' OR (attempt_failed>'.(ZBX_LOGIN_ATTEMPTS-1).
     //									' AND ('.time().'-attempt_clock)>'.ZBX_LOGIN_BLOCK.'))';
     $login = $attempt = DBfetch(DBselect($sql));
     if ($login) {
         if ($login['attempt_failed'] >= ZBX_LOGIN_ATTEMPTS) {
             if (time() - $login['attempt_clock'] < ZBX_LOGIN_BLOCK) {
                 $_REQUEST['message'] = S_CUSER_ERROR_ACCOUNT_IS_BLOCKED_FOR_XX_SECONDS_FIRST_PART . ' ' . (ZBX_LOGIN_BLOCK - (time() - $login['attempt_clock'])) . ' ' . S_CUSER_ERROR_ACCOUNT_IS_BLOCKED_FOR_XX_SECONDS_SECOND_PART;
                 return false;
             } else {
                 DBexecute('UPDATE users SET attempt_clock=' . time() . ' WHERE alias=' . zbx_dbstr($name));
             }
         }
         if ($auth_type != ZBX_AUTH_HTTP) {
             switch (get_user_auth($login['userid'])) {
                 case GROUP_GUI_ACCESS_INTERNAL:
                     $auth_type = ZBX_AUTH_INTERNAL;
                     break;
                 case GROUP_GUI_ACCESS_SYSTEM:
                 case GROUP_GUI_ACCESS_DISABLED:
                 default:
                     break;
             }
         }
         switch ($auth_type) {
             case ZBX_AUTH_LDAP:
                 $login = self::ldapLogin($user);
                 break;
             case ZBX_AUTH_HTTP:
                 $login = true;
                 break;
             case ZBX_AUTH_INTERNAL:
             default:
                 $login = true;
         }
     }
     if ($login) {
         $sql = 'SELECT u.* ' . ' FROM users u' . ' WHERE u.alias=' . zbx_dbstr($name) . (ZBX_AUTH_INTERNAL == $auth_type ? ' AND u.passwd=' . zbx_dbstr($password) : '') . ' AND ' . DBin_node('u.userid', $ZBX_LOCALNODEID);
         $login = $user = DBfetch(DBselect($sql));
     }
     /* update internal pass if it's different
     	if($login && ($row['passwd']!=$password) && (ZBX_AUTH_INTERNAL!=$auth_type)){
     		DBexecute('UPDATE users SET passwd='.zbx_dbstr(md5($password)).' WHERE userid='.$row['userid']);
     	}
     */
     if ($login) {
         $login = check_perm2login($user['userid']) && check_perm2system($user['userid']);
     }
     if ($login) {
         $sessionid = zbx_session_start($user['userid'], $name, $password);
         add_audit(AUDIT_ACTION_LOGIN, AUDIT_RESOURCE_USER, 'Correct login [' . $name . ']');
         if (empty($user['url'])) {
             $user['url'] = CProfile::get('web.menu.view.last', 'index.php');
         }
         $USER_DETAILS = $user;
         $login = $sessionid;
     } else {
         $user = NULL;
         $_REQUEST['message'] = S_CUSER_ERROR_LOGIN_OR_PASSWORD_INCORRECT;
         add_audit(AUDIT_ACTION_LOGIN, AUDIT_RESOURCE_USER, 'Login failed [' . $name . ']');
         if ($attempt) {
             $ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
             $attempt['attempt_failed']++;
             $sql = 'UPDATE users ' . ' SET attempt_failed=' . $attempt['attempt_failed'] . ',' . ' attempt_clock=' . time() . ',' . ' attempt_ip=' . zbx_dbstr($ip) . ' WHERE userid=' . $attempt['userid'];
             DBexecute($sql);
         }
     }
     return $login;
 }
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:92,代码来源:class.cuser.php


示例18: get_user_system_auth

function get_user_system_auth($userid)
{
    $result = ZBX_AUTH_INTERNAL;
    $user_auth = get_user_auth($userid);
    switch ($user_auth) {
        case GROUP_GUI_ACCESS_SYSTEM:
            $config = select_config();
            $result = $config['authentication_type'];
            break;
        case GROUP_GUI_ACCESS_INTERNAL:
        case GROUP_GUI_ACCESS_DISABLED:
        default:
            break;
    }
    return $result;
}
开发者ID:rennhak,项目名称:zabbix,代码行数:16,代码来源:perm.inc.php


示例19: elseif

} elseif (isset($_REQUEST['del_user_media'])) {
    $user_medias_to_del =  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_user_avatar函数代码示例发布时间:2022-05-15
下一篇:
PHP get_user_accessdata函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap