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


PHP get_userid函数代码示例

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


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

示例1: before_filter

 /**
  * This function is called before any output is generated or any other
  * actions are performed. Initializations happen here.
  *
  * @param $action Name of the action to perform
  * @param $args   Arguments for the given action
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $this->modules = array();
     // Set Navigation
     PageLayout::setHelpKeyword("Basis.ProfileModules");
     PageLayout::setTitle(_("Mehr Funktionen"));
     PageLayout::addSqueezePackage('lightbox');
     Navigation::activateItem('/profile/modules');
     // Get current user.
     $this->username = Request::username('username', $GLOBALS['user']->username);
     $this->user_id = get_userid($this->username);
     $this->plugins = array();
     $blubber = PluginEngine::getPlugin('Blubber');
     // Add blubber to plugin list so status can be updated.
     if ($blubber) {
         $this->plugins[] = $blubber;
     }
     // Get homepage plugins from database.
     $this->plugins = array_merge($this->plugins, PluginEngine::getPlugins('HomepagePlugin'));
     // Show info message if user is not on his own profile
     if ($this->user_id != $GLOBALS['user']->id) {
         $current_user = User::find($this->user_id);
         $message = sprintf(_('Daten von: %s %s (%s), Status: %s'), htmlReady($current_user->Vorname), htmlReady($current_user->Nachname), htmlReady($current_user->username), htmlReady($current_user->perms));
         PageLayout::postMessage(MessageBox::info($message));
     }
     $this->setupSidebar();
 }
开发者ID:ratbird,项目名称:hope,代码行数:35,代码来源:profilemodules.php

示例2: smarty_modifier_cms_date_format

function smarty_modifier_cms_date_format($string, $format = '', $default_date = '')
{
    $gCms = cmsms();
    if ($format == '') {
        $format = get_site_preference('defaultdateformat');
        if ($format == '') {
            $format = '%b %e, %Y';
        }
        if (!isset($gCms->variables['page_id'])) {
            $uid = get_userid(false);
            if ($uid) {
                $tmp = get_preference($uid, 'date_format_string');
                if ($tmp != '') {
                    $format = $tmp;
                }
            }
        }
    }
    $config = $gCms->GetConfig();
    $fn = cms_join_path($config['root_path'], 'lib', 'smarty', 'plugins', 'modifier.date_format.php');
    if (!file_exists($fn)) {
        die;
    }
    require_once $fn;
    return smarty_modifier_date_format($string, $format, $default_date);
}
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:26,代码来源:modifier.cms_date_format.php

示例3: updatecontentobj

function updatecontentobj(&$contentobj, $preview = false, $params = null)
{
    if ($params == null) {
        $params = $_POST;
    }
    $userid = get_userid();
    $adminaccess = check_ownership($userid, $contentobj->Id()) || check_permission($userid, 'Modify Any Page');
    #Fill contentobj with parameters
    $contentobj->FillParams($params);
    if ($preview) {
        $error = $contentobj->ValidateData();
    }
    if (isset($params["ownerid"])) {
        $contentobj->SetOwner($params["ownerid"]);
    }
    $contentobj->SetLastModifiedBy($userid);
    // 	#Fill Additional Editors (kind of kludgy)
    // 	if (isset($params["additional_editors"]))
    // 	{
    // 		$addtarray = array();
    // 		foreach ($params["additional_editors"] as $addt_user_id)
    // 		{
    // 			$addtarray[] = $addt_user_id;
    // 		}
    // 		$contentobj->SetAdditionalEditors($addtarray);
    // 	}
    // 	else if ($adminaccess)
    // 	{
    // 		$contentobj->SetAdditionalEditors(array());
    // 	}
}
开发者ID:rasomu,项目名称:chuza,代码行数:31,代码来源:editcontent_extra.php

示例4: is_sitedown

/**
 * A convenience function to test if the site is marked as down according to the config panel.
 * This method includes handling the preference that indicates that site-down behaviour should
 * be disabled for certain IP address ranges.
 *
 * @return boolean
 */
function is_sitedown()
{
    global $CMS_INSTALL_PAGE;
    if (isset($CMS_INSTALL_PAGE)) {
        return TRUE;
    }
    if (get_site_preference('enablesitedownmessage') !== '1') {
        return FALSE;
    }
    if (get_site_preference('sitedownexcludeadmins')) {
        $uid = get_userid(FALSE);
        if ($uid) {
            return FALSE;
        }
    }
    if (!isset($_SERVER['REMOTE_ADDR'])) {
        return TRUE;
    }
    $excludes = get_site_preference('sitedownexcludes', '');
    if (empty($excludes)) {
        return TRUE;
    }
    $tmp = explode(',', $excludes);
    $ret = cms_ipmatches($_SERVER['REMOTE_ADDR'], $excludes);
    if ($ret) {
        return FALSE;
    }
    return TRUE;
}
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:36,代码来源:content.functions.php

示例5: search_vuln

function search_vuln($scanID)
{
    $pScanID = $scanID;
    // echo $pScanID.'<br>';
    if ($userid = get_userid()) {
        // echo $userid . '<br>';
    } else {
        die;
    }
    $query = "SELECT Vuln.IP_URL,Plugin.Name,Vuln.Vuln_Info,Vuln.Level FROM Plugin,Scan,Vuln WHERE Vuln.Scan_ID=Scan.ID AND Vuln.Plugin_ID=Plugin.ID AND Scan.ID={$scanID} AND Scan.User_ID='{$userid}' ORDER BY Vuln.IP_URL,Vuln.Level,Vuln.ID";
    // echo $query.'<br>';
    $ret = array();
    $result = mysql_query($query);
    while ($row = mysql_fetch_row($result)) {
        // var_dump($row);
        foreach ($row as $key => $value) {
            // echo $key.' => '.$value;
            $row[$key] = check_xss($value);
        }
        $ipurl = $row[0];
        $ret[$ipurl][] = array_slice($row, 1);
    }
    // var_dump($ret);
    return $ret;
}
开发者ID:chris1201,项目名称:Hammer,代码行数:25,代码来源:vulns_search.php

示例6: PrePopulateAdminForm

 function PrePopulateAdminForm($formDescriptor)
 {
     $mod = $this->form_ptr->module_ptr;
     $main = array(array($mod->Lang('title_text'), $mod->CreateTextArea(get_preference(get_userid(), 'use_wysiwyg') == '1', $formDescriptor, $this->GetOption('text', ''), 'fbrp_opt_text', 'pageheadtags')));
     $adv = array(array($mod->Lang('title_smarty_eval'), $mod->CreateInputCheckbox($formDescriptor, 'fbrp_opt_smarty_eval', '1', $this->GetOption('smarty_eval', '0'))));
     return array('main' => $main, 'adv' => $adv);
 }
开发者ID:designondemand,项目名称:formbuilder,代码行数:7,代码来源:StaticTextField.class.php

示例7: SMS_ADD_POST

function SMS_ADD_POST($person = 0, $content = 0, $type, $url = 0, $userid)
{
    //发送消息表
    $sms_send = array('receiveperson' => $person, 'content' => $content, 'uid' => $userid, 'date' => get_date('y-m-d H:i:s', PHP_TIME));
    insert_db('sms_send', $sms_send);
    global $db;
    $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "sms_send  WHERE receiveperson = '" . $person . "' and uid='" . $userid . "' order by id desc");
    $id = $blog["id"];
    //获取字符串
    $receivepersonarr = explode(',', $person);
    //发送消息表
    for ($i = 0; $i < sizeof($receivepersonarr); $i++) {
        //接收消息表
        $sms_receive = array('sendperson' => $userid, 'date' => get_date('y-m-d H:i:s', PHP_TIME), 'content' => $content, 'receiveperson' => get_userid($receivepersonarr[$i]), 'type' => '2', 'smskey' => '1', 'sendid' => $id);
        //接收消息表
        insert_db('sms_receive', $sms_receive);
    }
    if ($id != '') {
        $oalog = array('uid' => $userid, 'content' => $content . get_log(1) . $person, 'title' => '发布短消息', 'startdate' => get_date('Y-m-d H:i:s', PHP_TIME), 'contentid' => $id, 'type' => '4');
        insert_db('oalog', $oalog);
    }
    if ($type == '1') {
        goto_page($url);
    }
}
开发者ID:haogm123,项目名称:ydoa,代码行数:25,代码来源:sms.class.php

示例8: act_insert

 public function act_insert()
 {
     $emails = isset($_POST['emails']) ? trim($_POST['emails']) : "";
     $accounts = isset($_POST['accounts']) ? $_POST['accounts'] : "";
     $emails = explode(",", $emails);
     $emails = array_filter($emails);
     $userId = get_userid();
     foreach ($emails as $key => $value) {
         if (!preg_match("/^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})\$/", $value)) {
             self::$errMsg[10061] = get_promptmsg(10061, "邮箱格式有误导致");
             return false;
         }
         foreach ($accounts as $account) {
             $data['email'] = $value;
             $data['accountId'] = $account;
             $data['createTime'] = time();
             $data['creatorId'] = get_userid();
             $data['modefyTime'] = time();
             $msg = M('PaypalEmail')->insertData($data);
             if (!$msg) {
                 self::$errMsg[10061] = get_promptmsg(10061, "插入数据库出错导致");
                 return false;
             }
         }
     }
     self::$errMsg[200] = get_promptmsg(200, "添加paypalEmail");
     return true;
 }
开发者ID:ohjack,项目名称:newErp,代码行数:28,代码来源:paypalEmail.action.php

示例9: add_comment

function add_comment()
{
    global $db, $fullsite, $cla_cid, $cla_nid, $cla_site, $ts_config;
    $result = array('result' => -1, 'data' => '');
    if (!is_login()) {
        die(json_encode($result));
    }
    $user_info = get_user_info_login();
    $user_id = get_userid();
    $comment = __post('comment');
    $post_id = (int) __post('post_id');
    $token = __post('token');
    $tokenCheck = md5(md5($post_id));
    if ($token != $tokenCheck) {
        $result['result'] = -2;
        die(json_encode($result));
    }
    $sSQL = " insert into ntk_forum_comments(user_id,post_id,content,`status`,create_date)\n\t\t\t\tvalues({$user_id},{$post_id},'{$comment}',0,NOW() )\n\t\t\t";
    $resultSQL = $db->query($sSQL, true, "Query failed");
    $result['result'] = 1;
    $html_comment = '<div class="forum_comment ' . $class . '">';
    $html_comment .= '<div class="forum_comment_header">';
    $html_comment .= '<span class="forum_comment_full_name">' . $user_info['full_name'] . '</span>&nbsp;&nbsp;&nbsp;&nbsp;';
    $html_comment .= '<span class="forum_comment_date">' . date("d/m/Y H:i:s") . '</span><br>';
    $html_comment .= '</div>';
    $html_comment .= '<div class="forum_comment_content">';
    $html_comment .= '&nbsp;&nbsp;&nbsp;&nbsp;<pre>' . $comment . '<pre>';
    $html_comment .= '</div>';
    $html_comment .= '</div>';
    $result['data'] = $html_comment;
    die(json_encode($result));
}
开发者ID:congtt,项目名称:pj.ntk,代码行数:32,代码来源:ntk-ajax.php

示例10: check

 public function check($data, $virtualobject, $relevantfields)
 {
     $errors = "";
     if (!$data['user_id']) {
         if (!$data['username']) {
             $errors .= "Kein Nutzername. ";
         } else {
             $validator = new email_validation_class();
             if (!$validator->ValidateUsername($data['username'])) {
                 $errors .= "Nutzername syntaktisch falsch. ";
             } elseif (get_userid($data['username']) && get_userid($data['username']) !== $data['user_id']) {
                 $errors .= "Nutzername schon vergeben. ";
             }
         }
         if (!$data['perms'] || !in_array($data['perms'], array("user", "autor", "tutor", "dozent", "admin", "root"))) {
             $errors .= "Keine korrekten Perms gesetzt. ";
         }
         if (!$data['vorname'] && !$data['nachname']) {
             $errors .= "Kein Name gesetzt. ";
         }
     }
     if (in_array("email", $relevantfields)) {
         if (!$data['email']) {
             $errors .= "Keine Email. ";
         } else {
             $validator = new email_validation_class();
             if (!$validator->ValidateEmailAddress($data['email'])) {
                 $errors .= "Email syntaktisch falsch. ";
             }
         }
     }
     return $errors;
 }
开发者ID:Krassmus,项目名称:Fleximport,代码行数:33,代码来源:FleximportUserChecker.class.php

示例11: TabNames

 function TabNames()
 {
     $res = array(lang('main'));
     if (check_permission(get_userid(), 'Manage All Content')) {
         $res[] = lang('options');
     }
     return $res;
 }
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:8,代码来源:SectionHeader.inc.php

示例12: act_insert

 /**
  * 新增平台信息
  * @return array
  * @author lzx
  */
 public function act_insert()
 {
     $data = array();
     $data['platform'] = isset($_POST['platform']) ? trim($_POST['platform']) : '';
     $data['shortcode'] = isset($_POST['shortcode']) ? trim($_POST['shortcode']) : '';
     $data['suffix'] = isset($_POST['suffix']) ? trim($_POST['suffix']) : '';
     $data['addUser'] = get_userid();
     $data['addTime'] = time();
     return M('Platform')->insertData($data);
 }
开发者ID:ohjack,项目名称:newErp,代码行数:15,代码来源:platform.action.php

示例13: act_insert

 public function act_insert()
 {
     $id = isset($_POST['currId']) ? $_POST['currId'] : '';
     $data = array();
     $data['currency'] = isset($_POST['currency']) ? $_POST['currency'] : '';
     $data['rates'] = isset($_POST['rates']) ? $_POST['rates'] : '';
     $data['userId'] = get_userid();
     $data['modefyTime'] = time();
     return M('Currency')->insertData($data);
 }
开发者ID:ohjack,项目名称:newErp,代码行数:10,代码来源:currency.action.php

示例14: view_edit

 public function view_edit()
 {
     //面包屑
     $navlist = array(array('url' => 'index.php?mod=user&act=index', 'title' => '授权管理'), array('url' => '#', 'title' => '用户列表'), array('url' => 'index.php?mod=user&act=edit&uid=' . $id, 'title' => '编辑'));
     $userInfo = A('User')->act_getUserInfoById(get_userid());
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toptitle', '编辑');
     $this->smarty->assign('userInfo', $userInfo);
     $this->smarty->display("userModify.htm");
 }
开发者ID:ohjack,项目名称:newErp,代码行数:10,代码来源:user.view.php

示例15: act_update

 public function act_update()
 {
     $data = array();
     $id = isset($_POST['id']) ? trim($_POST['id']) : '';
     $data['type'] = isset($_POST['type']) ? trim($_POST['type']) : '';
     $data['status'] = isset($_POST['status']) ? trim($_POST['status']) : '';
     $data['errormsg'] = isset($_POST['errormsg']) ? trim($_POST['errormsg']) : '';
     $data['lastmodifyuserId'] = get_userid();
     $data['lastmodefyTime'] = time();
     return M('PromptMsg')->updateData($id, $data);
 }
开发者ID:ohjack,项目名称:newErp,代码行数:11,代码来源:promptMsg.action.php


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