当前位置: 首页>>代码示例>>PHP>>正文


PHP get_user_auth函数代码示例

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


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


注:本文中的get_user_auth函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。