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

PHP getCurrentUserId函数代码示例

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

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



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

示例1: get_group

/**
* 获取指定群信息
* @UserFunction(method = GET)
* @CheckLogin
*/
function get_group(Integer $id)
{
    $db = new DataBase(DB_DNS, DB_USER, DB_PASSWORD);
    $user_id = getCurrentUserId();
    $group = $db->fetch('SELETE * FROM `group` WHERE `id` = ?', $id);
    $group['users'] = $db->fetchAll('SELECT a.`id`, a.`username`, a.`portrait` FROM `user` AS a INNER JOIN `group_user` AS b ON  b.user_id=a.id WHERE b.group_id = ?', $id);
    return $group;
}
开发者ID:huashihongfeng,项目名称:demo-server-php,代码行数:13,代码来源:GroupProcess.php


示例2: storeVideo

function storeVideo($url, $embeded, $headline, $year)
{
    $db = getDB();
    $sql = "INSERT INTO video (url,embeded,headline,year,datum,userid) VALUES ('" . mysql_real_escape_string($url) . "','" . $embeded . "','" . mysql_real_escape_string($headline) . "'," . $year . ",now()," . getCurrentUserId() . ")";
    $result = mysql_query($sql);
    if (mysql_affected_rows() != 1 || $errorno != 0) {
        echo "<center class=\"error\">Eintrag fehlgeschlagen</center>";
    } else {
        echo "<center class=\"successful\">Eintrag erfolgreich</center>";
    }
}
开发者ID:tgassner,项目名称:Blechophon,代码行数:11,代码来源:video.inc.php


示例3: getCurrentUserId

<?php

require "login/login.php";
include 'monitor.inc';
$userId = getCurrentUserId();
$id = $_REQUEST['id'];
if ($id) {
    $folderId = getFolderIdFor($id, 'WPTJob');
} else {
    $folderId = $_REQUEST['folderId'];
}
if ($_REQUEST['active']) {
    $active = 1;
} else {
    $active = 0;
}
$label = $_REQUEST['label'];
$description = $_REQUEST['description'];
$location = $_REQUEST['location'];
$script = $_REQUEST['script'];
$alerts = $_REQUEST['alerts'];
// Extract host and location from $location field
$hostloc = explode(" ", $location);
$host = $hostloc[0];
$location = $hostloc[1];
$frequency = $_REQUEST['frequency'];
$maxDownloadAttempts = $_REQUEST['maxdownloadattempts'];
$numberOfRuns = $_REQUEST['numberofruns'];
$runToUserForAverage = $_REQUEST['runtouseforaverage'];
if ($runToUserForAverage > $numberOfRuns) {
    $smarty->assign('errorMessage', "Run to use for average must be equal to or less than number of runs.");
开发者ID:mieshco,项目名称:webpagetest-monitor,代码行数:31,代码来源:updateJob.php


示例4: Share

<?php

require "login/login.php";
include_once 'monitor.inc';
if (isset($_REQUEST['id'])) {
    $shareId = $_REQUEST['id'];
    $shareTable = Doctrine_Core::getTable('Share');
    $share = $shareTable->find($shareId);
} else {
    $share = new Share();
    $share['TheTableName'] = $_REQUEST['tableName'];
    $share['TableItemId'] = $_REQUEST['folderId'];
}
$userTable = Doctrine_Core::getTable('User');
$users = $userTable->findAll();
foreach ($users as $user) {
    if ($user['Id'] == getCurrentUserId()) {
        continue;
    }
    $u = $user['Id'];
    $userName[$u] = $user['Username'];
}
$folderTable = Doctrine_Core::getTable($share['TheTableName'] . 'Folder');
$folder = $folderTable->find($share['TableItemId']);
$smarty->assign('folderName', $folder['Label']);
if (!isset($userName)) {
    $userName = '';
}
$smarty->assign('userName', $userName);
$smarty->assign('share', $share);
$smarty->display('user/addShare.tpl');
开发者ID:risyasin,项目名称:webpagetest,代码行数:31,代码来源:editShare.php


示例5: get_friend

/**
* 获取好友列表
* @UserFunction(method = GET|POST)
* @CheckLogin
*/
function get_friend()
{
    $db = new DataBase(DB_DNS, DB_USER, DB_PASSWORD);
    $friends = $db->fetchAll('SELECT A.`id`,`email`,`username`,`portrait`,`status` FROM `friend` INNER JOIN `user` AS A ON `friend_id`=A.`id` WHERE `user_id`=?;', getCurrentUserId());
    return $friends;
}
开发者ID:huashihongfeng,项目名称:demo-server-php,代码行数:11,代码来源:FriendProcess.php


示例6: select_rub

function select_rub($id_cde, $id_rubrique = 0)
{
    global $msg, $charset;
    global $select_rub;
    $cde = new actes($id_cde);
    if ($cde->statut >= STA_ACT_ARC) {
        //Commande archivée, facture non modifiable
        $lig_rub = $select_rub[1];
        if (!$id_rubrique) {
            $id_rubrique = 0;
            $lib_rub = '';
        } else {
            $rub = new rubriques($id_rubrique);
            $bud = new budgets($rub->num_budget);
            $lib_bud = $bud->libelle;
            $tab_rub = rubriques::listAncetres($id_rubrique, true);
            $lib_rub = $lib_bud . ':';
            foreach ($tab_rub as $value) {
                $lib_rub .= htmlentities($value[1], ENT_QUOTES, $charset);
                if ($value[0] != $id_rubrique) {
                    $lib_rub .= ":";
                }
            }
        }
        $lig_rub = str_replace('!!id_rub!!', $id_rubrique, $lig_rub);
        $lig_rub = str_replace('!!lib_rub!!', $lib_rub, $lig_rub);
    } else {
        //Commande non archivée, modification des rubriques possible
        if (!$id_rubrique) {
            //Pas de rubrique sélectionnée
            $lig_rub = $select_rub[0];
            $lig_rub = str_replace('!!id_rub!!', 0, $lig_rub);
            $lig_rub = str_replace('!!lib_rub!!', '', $lig_rub);
        } else {
            //Rubrique selectionnée
            $user_userid = getCurrentUserId();
            $rub = new rubriques($id_rubrique);
            $bud = new budgets($rub->num_budget);
            if (!rubriques::getAutorisations($id_rubrique, $user_userid)) {
                //L'utilisateur n'a pas de droits sur la rubrique
                $lig_rub = $select_rub[1];
            } else {
                //L'utilisateur à des droits sur la rubrique
                $lig_rub = $select_rub[0];
            }
            $lig_rub = str_replace('!!id_rub!!', $rub->id_rubrique, $lig_rub);
            $lib_bud = htmlentities($bud->libelle, ENT_QUOTES, $charset);
            $tab_rub = rubriques::listAncetres($id_rubrique, true);
            $lib_rub = $lib_bud . ':';
            foreach ($tab_rub as $value) {
                $lib_rub .= htmlentities($value[1], ENT_QUOTES, $charset);
                if ($value[0] != $id_rubrique) {
                    $lib_rub .= ":";
                }
            }
            $lig_rub = str_replace('!!lib_rub!!', $lib_rub, $lig_rub);
        }
    }
    return $lig_rub;
}
开发者ID:bouchra012,项目名称:PMB,代码行数:60,代码来源:frame_facture.php


示例7: getRootFolderForUser

}
if (!isset($_SESSION['changeNoteFolderId'])) {
    $_SESSION['changeNoteFolderId'] = getRootFolderForUser($user_id, 'ChangeNote');
}
$folderId = $_SESSION['changeNoteFolderId'];
$smarty->assign('folderId', $_SESSION['changeNoteFolderId']);
$folderTree = getFolderTree($user_id, 'ChangeNote');
$smarty->assign('folderTree', $folderTree);
try {
    $q = Doctrine_Query::create()->from('ChangeNote c, c.ChangeNoteFolder f')->groupBy('c.Id');
    if ($folderId > -1 && hasPermission('ChangeNote', $folderId, PERMISSION_READ)) {
        $q->andWhere('c.ChangeNoteFolderId = ?', $folderId);
    } else {
        $q->andWhere('c.UserId = ?', $user_id)->orWhere('c.Public = ?', true);
    }
    $pager = new Doctrine_Pager($q, $changeNotesCurrentPage, $resultsPerPage);
    $result = $pager->execute();
    //  $changeNoteTable = Doctrine_Core::getTable('ChangeNote');
    //  $changeNotes = $changeNoteTable->findAll();
    $smarty->assign('result', $result);
} catch (Exception $e) {
    error_log("[WPTMonitor] Failed while Listing Change Notes: " . $e->getMessage());
}
unset($changeNotes);
$smarty->assign('userId', getCurrentUserId());
$shares = getFolderShares($user_id, 'ChangeNote');
$smarty->assign('shares', $shares);
$smarty->display('changenote/listChangeNotes.tpl');
?>
 
开发者ID:mieshco,项目名称:webpagetest-monitor,代码行数:29,代码来源:listChangeNotes.php


示例8: ChangeNote

<?php

require "login/login.php";
include 'monitor.inc';
$folderId = $_REQUEST['folderId'];
if (!hasPermission('ChangeNote', $folderId, PERMISSION_UPDATE)) {
    echo "Invalid Permission";
    exit;
}
if (isset($_REQUEST['id'])) {
    $id = $_REQUEST['id'];
    $changeNoteTable = Doctrine_Core::getTable('ChangeNote');
    $changeNote = $changeNoteTable->find($id);
} else {
    $changeNote = new ChangeNote();
}
$folderTree = getFolderTree(getCurrentUserId(), 'ChangeNote');
$shares = getFolderShares(getCurrentUserId(), 'ChangeNote');
$smarty->assign('folderTree', $folderTree);
$smarty->assign('shares', $shares);
$smarty->assign('folderId', $folderId);
$smarty->assign('result', $changeNote);
$smarty->display('changenote/addChangeNote.tpl');
开发者ID:mieshco,项目名称:webpagetest-monitor,代码行数:23,代码来源:editChangeNote.php


示例9: Strafgesetzbuches

        krass unsachliche, rechtswidrige oder moralisch bedenkliche Beitr&auml;ge sowie Beitr&auml;ge, die dem Ansehen des Mediums schaden,
        zu l&ouml;schen.
        Sie als Verfasser haften f&uuml;r s&auml;mtliche von Ihnen ver&ouml;ffentlichte Beitr&auml;ge selbst und k&ouml;nnen daf&uuml;r auch gerichtlich
        zur Verantwortung gezogen werden. Beachten Sie daher bitte, dass auch die freie Meinungs&auml;u&szlig;erung im Internet den Schranken
        des geltenden Rechts, insbesondere des Strafgesetzbuches (&Uuml;ble Nachrede, Ehrenbeleidigung etc.) und des Verbotsgesetzes,
        unterliegt. Die Redaktion beh&auml;lt sich vor, strafrechtlich relevante Tatbest&auml;nde gegebenenfalls den zust&auml;ndigen Beh&ouml;rden
        zur Kenntnis zu bringen.
        Die Chatiquette und Netiquette sind zu akzeptieren und einzuhalten! 
        <br><br>
      </div>  

        <?php 
    $name = "";
    $email = "";
    if (1 == 2 && yisLoggedIn()) {
        $user = getFullUserByID(getCurrentUserId());
        $name = $user->getSpitznameOrVorname();
        $email = $user->getemail();
    }
    ?>

      
    <form name="gaestbook" method="post" action="<?php 
    echo $_SERVER["PHP_SELF"] . "?" . $QUERY_STRING;
    ?>
" onSubmit="return checkform()">
    <table align=center cellpadding="0" cellspacing="0" border="0">
      <tr>
        <td class="links"> Name: </td>
        <td> <input type="Text" name="name" value="<?php 
    echo $name;
开发者ID:tgassner,项目名称:Blechophon,代码行数:31,代码来源:gaestebuch.php


示例10: chdir

<?php

chdir('..');
include_once 'monitor.inc';
include_once 'graph_functions.inc';
include_once 'firephp/0.3.2/fb.php';
include_once 'utils.inc';
include_once 'jash/functions.inc';
header('Content-Type: application/json');
header('Cache-Control: public', TRUE);
if ($_SESSION['ls_admin']) {
    ini_set('max_execution_time', 120);
}
$requestData = $_POST;
$response = array('status' => null, 'message' => null, 'results' => null);
if (null === ($userId = getCurrentUserId())) {
    $response['message'] = 'Not logged in.';
    $response['status'] = 401;
    echo json_encode($response);
    die;
}
session_write_close();
if (array_key_exists('action', $_GET) && $_GET['action'] == 'getMaxExecutionTime') {
    header("Expires: " . gmdate("D, d M Y H:i:s", time() + 60) . " GMT");
    header_remove("Pragma");
    $response['status'] = 200;
    $response['message'] = 'OK';
    $response['results'] = array('max_execution_time' => ini_get('max_execution_time'));
    echo json_encode($response);
    die;
}
开发者ID:mieshco,项目名称:webpagetest-monitor,代码行数:31,代码来源:flashGraph.json.php


示例11: Share

include 'monitor.inc';
$folderId = $_REQUEST['tableItemId'];
$tableName = $_REQUEST['tableName'];
$shareId = $_REQUEST['id'];
if (!$_REQUEST['active']) {
    $active = false;
} else {
    $active = true;
}
try {
    if ($shareId) {
        $shareTable = Doctrine_Core::getTable('Share');
        $share = $shareTable->find($shareId);
    }
    if (!$share) {
        $share = new Share();
    }
    $share['Active'] = $active;
    $share['UserId'] = getCurrentUserId();
    $share['ShareWithUserId'] = $_REQUEST['shareWithUserId'];
    $share['TheTableName'] = $_REQUEST['tableName'];
    $share['TableItemId'] = $_REQUEST['tableItemId'];
    $share['Permissions'] = $_REQUEST['permissions'];
    $share->save();
} catch (Exception $e) {
    error_log("[WPTMonitor] Failed while updating share: " . $id . " message: " . $e->getMessage());
    echo $e->getMessage();
    exit;
}
header("Location: listShares.php?folderId=" . $folderId . "&folder=" . $folder . "&tableName=" . $tableName);
exit;
开发者ID:mieshco,项目名称:webpagetest-monitor,代码行数:31,代码来源:updateShare.php


示例12: setTime

 function setTime(&$arrOutput = array(), $mode = '')
 {
     if (isset($arrOutput['name']) && $arrOutput['name'] != '') {
         $arrOutput['encode'] = replaceUnicode($arrOutput['name']);
     }
     if (isset($arrOutput['password']) && $arrOutput['password'] != '') {
         $arrOutput['password'] = md5($arrOutput['password']);
     }
     switch ($mode) {
         case MODE_ADD:
             $arrOutput['create_at'] = getCurrentDt();
             $arrOutput['create_by'] = getCurrentUserId();
             break;
         case MODE_EDIT:
             $arrOutput['update_at'] = getCurrentDt();
             $arrOutput['update_by'] = getCurrentUserId();
             break;
         case MODE_DELETE:
             $arrOutput['delete_at'] = getCurrentDt();
             $arrOutput['delete_by'] = getCurrentUserId();
             break;
     }
 }
开发者ID:thaivuong90,项目名称:ban_hang,代码行数:23,代码来源:common_helper.php


示例13: getInsertUpdate

 /**
  * getInsertUpdate
  *
  * @param type $arrData
  * @return boolean
  */
 public function getInsertUpdate($arrData = array())
 {
     $this->db->trans_start();
     if ($arrData['data']['order_by'] > 0) {
         $sql .= "\tUPDATE news \t";
         $sql .= "\tSET order_by = order_by + 1 \t";
         $sql .= "\twhere order_by >=  \t" . $arrData['data']['order_by'];
         $this->db->query($sql);
     } else {
         $arrData['data']['order_by'] = getMaxValue('order_by', 'news') + 1;
     }
     if (!isset($arrData['data']['id']) || $arrData['data']['id'] == '') {
         setTime($arrData['data'], MODE_ADD);
         if (!isset($arrData['data']['publish_at']) || $arrData['data']['publish_at'] == '') {
             $arrData['data']['publish_at'] = $arrData['data']['create_at'];
             if (isset($arrData['data']['status']) && $arrData['data']['status'] == 1) {
                 $arrData['data']['publish_by'] = getCurrentUserId();
             }
         }
         $this->db->insert('news', $arrData['data']);
     } else {
         setTime($arrData, MODE_EDIT);
         if (isset($arrData['data']['status']) && $arrData['data']['status'] == 1) {
             $arrData['data']['publish_by'] = getCurrentUserId();
         }
         $this->db->where('id', $arrData['data']['id']);
         $this->db->update('news', $arrData['data']);
     }
     if ($this->db->trans_complete()) {
         return true;
     }
 }
开发者ID:thaivuong90,项目名称:ban_hang,代码行数:38,代码来源:news_model.php


示例14: update_profile

/**
* 获取某人用户资料
* @UserFunction(method = POST)
* @CheckLogin
*/
function update_profile(string $username)
{
    $db = new DataBase(DB_DNS, DB_USER, DB_PASSWORD);
    $db->exec('UPDATE `user` SET `username`= ?  WHERE `id` = ?', $username, getCurrentUserId());
}
开发者ID:huashihongfeng,项目名称:demo-server-php,代码行数:10,代码来源:UserProcess.php


示例15: addVideo

?>

<?php 
function addVideo()
{
    if (isLoggedIn()) {
        if (hasCurrentUserRight("video")) {
开发者ID:tgassner,项目名称:Blechophon,代码行数:7,代码来源:videos.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getCurrentUserInfo函数代码示例发布时间:2022-05-15
下一篇:
PHP getCurrentUserGroupList函数代码示例发布时间: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