本文整理汇总了PHP中getUserId函数的典型用法代码示例。如果您正苦于以下问题:PHP getUserId函数的具体用法?PHP getUserId怎么用?PHP getUserId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getUserId函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: doAdd
/**
* api新增操作
*/
public function doAdd()
{
$api = D('Api')->create();
if (!$api) {
$this->ajaxReturn(null, D('Api')->getError(), 'success:false');
}
//判断传入参数是否符合格式
$api = D('Api')->parseRequestHeader($api);
if (empty($api)) {
$this->ajaxReturn(0, "请求头信息输入不正确,请检查格式!", "success:false");
}
$api['userId'] = getUserId();
//判断传入参数是否重复
$condition['host'] = $api['host'];
$condition['method'] = $api['method'];
$condition['path'] = $api['path'];
$condition = $this->merge($condition);
$temp = D('Api')->checkDuplicate($condition);
if (!empty($temp)) {
$this->ajaxReturn(0, "已经有相同的api存在,不允许重复录入", "success:false");
}
$ret = D('Api')->add($api);
if ($ret) {
$this->ajaxReturn($ret, "成功新增Api数据!", "success:true");
} else {
$this->ajaxReturn(0, "新增Api数据失败!", "success:false");
}
}
开发者ID:john1688,项目名称:BAT,代码行数:31,代码来源:ApiAction.class.php
示例2: doAdd
/**
* 执行新增操作
*/
public function doAdd()
{
$plan = D("Plan");
$data = M("Plan")->create();
if (!empty($data['data'])) {
$result = $plan->parseParam($data['data']);
if (!$result) {
$this->ajaxReturn(null, '您定义了私有参数,但是定义的格式有误!', 'success:false');
}
$ret = $plan->checkParam($result);
if ($ret['status'] === false) {
$this->ajaxReturn(null, "有部分参数定义无效[" . $ret['data'] . "]", 'success:false');
}
}
if (empty($data['caseIds'])) {
$this->ajaxReturn(null, "请添加测试用例", "success:false");
}
$data['caseIds'] = implode(',', $data['caseIds']);
$data['appId'] = getAppId();
$data['userId'] = getUserId();
$data['updateTime'] = getCurrentTime();
$ret = $plan->add($data);
if (empty($ret)) {
$this->ajaxReturn(null, '新增测试计划失败', 'success:false');
}
$this->ajaxReturn($ret, '成功', 'success:true');
}
开发者ID:john1688,项目名称:BAT,代码行数:30,代码来源:PlanAction.class.php
示例3: CT_Start_Default
function CT_Start_Default($target)
{
requireModel("blog.attachment");
requireComponent("Eolin.PHP.Core");
requireComponent("Textcube.Function.misc");
global $blogid, $blogURL, $database, $service;
$target .= '<ul>';
$target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF;
$latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0);
if ($latestEntryId !== 0) {
$latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId);
if ($latestEntry != false) {
$target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>';
}
}
if (Acl::check('group.administrators')) {
$target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF;
}
if ($service['reader'] != false) {
$target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF;
}
$target .= '</ul>';
return $target;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:28,代码来源:index.php
示例4: authenticate
function authenticate(\Slim\Route $route)
{
// Getting request headers
$headers = apache_request_headers();
$response = array();
$app = \Slim\Slim::getInstance();
// Verifying Authorization Header
if (isset($headers['Authorization'])) {
// get the api key
$api_key = $headers['Authorization'];
// validating api key
if (!ValidateAPIKey($api_key)) {
// api key is not present in users table
$response["error"] = true;
$response["message"] = "Access Denied. Invalid API key";
echoRespnse(401, $response);
$app->stop();
} else {
global $user_id;
// get user primary key id
$user_id = getUserId($api_key);
}
} else {
// api key is missing in header
$response["error"] = true;
$response["message"] = "API key is missing.";
echoRespnse(400, $response);
$app->stop();
}
}
开发者ID:puzzledplane,项目名称:SE2-Cloud,代码行数:30,代码来源:index.php
示例5: getQueryList
function getQueryList($sEmployeeId = '', $sDept = '', $sStat = '', $rType = '')
{
$sCondition = '';
$sDeptCondition = '';
$sStatCondition = '';
$sRtype = '';
if (!empty($sEmployeeId)) {
$sCondition = "and e.id = {$sEmployeeId}";
}
if (!empty($sStat) && strpos($sStat, "All") === false) {
$sStatCondition = "and g.status = '{$sStat}'";
}
if (!empty($sDept) && $sDept != -1) {
$sDeptCondition = "and e.department_id = {$sDept}";
}
if (!empty($rType)) {
$sRtype = '';
}
$iProfileId = getUserId($this);
if (getRole($this) == 2) {
$sdep = $this->mod->getDeptOfEmployee($iProfileId);
$sDeptCondition = "and (e.department_id = {$sdep[0]->department_id})";
} else {
if (getRole($this) == 3) {
$sDeptCondition = "and (e.id = {$iProfileId})";
}
}
$query = $this->db->query("\r\n select \r\n g.*,\r\n concat(e.fname,' ',e.lname) as employee,\r\n datediff(g.end_date, g.start_date) as leaves \r\n from \r\n leave_transactions g, \r\n employees e,\r\n employment em \r\n where (g.employment_id = em.id and em.employee_id = e.id) \r\n {$sCondition} \r\n {$sStatCondition} \r\n {$sDeptCondition}\r\n order by g.filing_date desc");
$aResult = $query->result();
return $query->result();
}
开发者ID:acelumaad,项目名称:leave-system,代码行数:31,代码来源:leave_transactions_model.php
示例6: getOSData
public function getOSData()
{
$cols = array('meta1', 'clicks', 'click_throughs', 'click_through_rates', 'leads', 'conv', 'payout', 'epc', 'income');
$sql = 'select adv.platform_id, ';
$sql .= getReportGeneralSelects() . 'from ';
$sql .= getReportFilters('platforms/os', 'left join bt_s_clicks_advanced as adv on (click.click_id=adv.click_id)');
$sql .= ' and adv.platform_id > 0 group by adv.platform_id ';
$result = DB::getRows($sql);
$cnt = count($result);
DB::query("delete from bt_c_statcache where user_id='" . DB::quote(getUserId()) . "' and type='platos'");
$bulk = new DB_Bulk_Insert('bt_c_statcache', array('user_id', 'type', 'clicks', 'click_throughs', 'click_through_rates', 'leads', 'conv', 'payout', 'epc', 'income', 'meta1'));
foreach ($result as $row) {
$row['platform_name'] = Browser::getPlatformName($row['platform_id']);
if (!$row['platform_name']) {
$row['platform_name'] = '[unknown os]';
}
$bulk->insert(array(DB::quote(getUserId()), "'platos'", $row['clicks'], $row['click_throughs'], $row['click_through_rates'], $row['leads'], $row['conv'], $row['payout'], $row['epc'], $row['income'], "'" . DB::quote($row['platform_name']) . "'"));
}
$bulk->execute();
$sql = "select * from bt_c_statcache where user_id='" . DB::quote(getUserId()) . "' and type='platos' ";
$sql .= getReportOrder($cols);
$sql .= getReportLimits();
$result = DB::getRows($sql);
return array('data' => $result, 'cnt' => $cnt, 'cols' => $cols);
}
开发者ID:sakibanda,项目名称:ballistic-tracking,代码行数:25,代码来源:PlatformsController.php
示例7: getlist_json_employee
function getlist_json_employee($employee, $bool)
{
$list = $this->base_model->getLeaveCreditsByEmployee($employee, $bool);
$date = $this->mod->getHireDateByEmployee(getUserId($this));
$arrayList = objectToArray($list);
$newArray = array();
foreach ($arrayList as $key => $value) {
$dayval = $value['days'];
$usercount = 0;
if ($value['date'] != '0000-00-00' && $value['date'] != '') {
$hired = strtotime($date);
$setdate = strtotime($value['date']);
if ($hired > $setdate) {
$dayval = $value['days_after'];
} else {
if ($hired < $setdate) {
$dayval = $value['days_before'];
}
}
}
if ($value['schoolyear'] === getSchoolYear($this)) {
$usercount = $value['usecount'];
}
array_push($newArray, array('id' => $value['id'], 'ltid' => $value['ltid'], 'title' => $value['title'], 'days' => $dayval, 'date' => $value['date'], 'days_before' => $value['days_before'], 'days_after' => $value['days_after'], 'usecount' => $usercount));
}
echo json_encode($newArray);
}
开发者ID:acelumaad,项目名称:leave-system,代码行数:27,代码来源:leave_credits.php
示例8: CT_Start_Default
function CT_Start_Default($target)
{
importlib("model.blog.attachment");
$context = Model_Context::getInstance();
$blogURL = $context->getProperty('uri.blog');
$blogid = $context->getProperty('blog.id');
$target .= '<ul>';
$target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF;
$latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0);
if ($latestEntryId !== 0) {
$latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId);
if ($latestEntry != false) {
$target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>';
}
}
if (Acl::check('group.administrators')) {
$target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF;
}
if ($context->getProperty('service.reader', false) != false) {
$target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF;
}
$target .= '</ul>';
return $target;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:28,代码来源:index.php
示例9: getListByQuery
function getListByQuery($query, $department, $rtype = '')
{
$sDeptCondition = '';
$sCondition = '';
$sYear = getSchoolYear($this);
if (getRole($this) == 2) {
$sDept = $this->mod->getDeptOfEmployee(getUserId($this));
$sDept = $sDept[0]->department_id;
$sDeptCondition = "employees.department_id = {$sDept} and";
}
$sDeptCondition = '';
$rCondition = '';
if (getRole($this) != 2 && ($department != -1 && !empty($department))) {
$sDeptCondition = "(employees.department_id = {$department}) and";
}
if (!empty($query)) {
$sCondition = "(employees.empno like '%{$query}%' or employees.fname like '%{$query}%' or employees.lname like '%{$query}%') and";
}
$iProfileId = getUserId($this);
if (getRole($this) == 2) {
$sdep = $this->mod->getDeptOfEmployee($iProfileId);
$sDeptCondition = "(employees.department_id = {$sdep[0]->department_id}) and ";
}
if (!empty($rtype)) {
if (strpos($rtype, 'nal') !== false) {
$rCondition = "and if(emp_types.time_unit = 'd', \r\n\r\n (select (sum(abs(datediff(g.end_date, g.start_date)) - abs(g.end_date_hw + g.start_date_hw)) +1)\r\n from \r\n leave_transactions g, leave_credits \r\n where \r\n\r\n employment_id = employment.id and \r\n leave_credits.id = leave_credits_id and \r\n leave_credits.is_base = 1 and g.schoolyear = '{$sYear}'),\r\n\r\n\r\n\r\n\r\n round(( select (sum(timediff(g.end_time,g.start_time)))/10000 from \r\n leave_transactions g \r\n where \r\n\r\n g.employment_id = employment.id and g.schoolyear = '{$sYear}'\r\n\r\n ),2)) is null";
}
}
$query = $this->db->query("\r\n select \r\n employees.id as myid, \r\n employment.*, \r\n employees.*,\r\n ranks.*,\r\n roles.*,\r\n departments.*,\r\n emp_types.*,\r\n status.*,\r\n emp_types.time_unit as timeunit\r\n from \r\n employment, \r\n emp_types, \r\n status, \r\n employees, \r\n emp_types_stat,\r\n ranks,\r\n departments,\r\n roles\r\n where \r\n ({$sCondition} {$sDeptCondition} \r\n employment.emp_types_stat_id = emp_types_stat.id and\r\n \r\n emp_types.id = emp_types_stat.emp_types_id and \r\n \r\n status.id = emp_types_stat.status_id and \r\n \r\n employment.employee_id = employees.id and\r\n \r\n employees.rank_id = ranks.id and\r\n \r\n employees.department_id = departments.id and\r\n \r\n employees.role_id = roles.id) {$rCondition} \r\n\r\n group by employees.department_id, lname, fname\r\n ");
if ($query->num_rows() > 0) {
return $query->result();
} else {
return "";
}
}
开发者ID:acelumaad,项目名称:leave-system,代码行数:35,代码来源:employment_model.php
示例10: edit
public function edit()
{
$this->checkAuth();
if ($_POST) {
$map['user_id'] = array('eq', getUserId());
$user = M('auth_user');
$user->startTrans();
$user->username = $_POST['username'];
$user->where('id = ' . getUserId())->save();
$profile = M('profile');
$profile->pic = $_POST['pic'];
$profile->location = $_POST['location'];
$profile->realname = $_POST['realname'];
$profile->aboutme = $_POST['aboutme'];
if ($_POST['birthday']) {
$profile->birthday = $_POST['birthday'];
} else {
$profile->birthday = null;
}
$profile->where($map)->save();
$user->commit();
}
$map['u.id'] = array('eq', getUserId());
$profile = M('auth_user u')->join('left join profile p on p.user_id = u.id ')->where($map)->field('u.id,u.username,u.date_joined,u.email,p.pic,p.reputation,p.location,p.realname,p.aboutme,p.birthday')->select();
$this->assign('profile', $profile[0]);
$this->display();
}
开发者ID:xiaobudian,项目名称:php,代码行数:27,代码来源:UserController.class.php
示例11: verifyPurchase
public function verifyPurchase($userId, $itemId, $transactions)
{
$transactionId = null;
$transactions = json_decode(stripslashes($transactions));
for ($i = 0; $i < count($transactions); $i++) {
if ($transactions[$i]->itemId == $itemId) {
$transactionId = $transactions[$i]->transactionId;
}
}
if ($transactionId) {
$postDetails = array(USER => UID, PWD => PASSWORD, SIGNATURE => SIG, METHOD => "GetTransactionDetails", VERSION => VER, TRANSACTIONID => $transactionId);
$arrPostVals = array_map(create_function('$key, $value', 'return $key."=".$value."&";'), array_keys($postDetails), array_values($postDetails));
$postVals = rtrim(implode($arrPostVals), "&");
$response = parseString(runCurl(URLBASE, $postVals));
$custom = explode("%2c", $response["CUSTOM"]);
if (getUserId() == $custom[0] && $itemId == $custom[1]) {
// ADDED LINE TO GET KS SESSION
$ks = getSession($itemId, $userId);
// ADD KS to ARRAY
$returnObj = array(success => true, error => "", transactionId => $response["TRANSACTIONID"], orderTime => $response["ORDERTIME"], paymentStatus => $response["PAYMENTSTATUS"], itemId => $itemId, userId => $userId, ks => $ks);
}
} else {
$returnObj = array(success => false, error => "Item not found in transaction history");
}
echo json_encode($returnObj);
}
开发者ID:Pingou,项目名称:tech-talks,代码行数:26,代码来源:pptransact.php
示例12: changePassword
function changePassword($aDetails)
{
$password = md5($aDetails['password']);
$id = getUserId($this);
$comp = $this->db->query("UPDATE `employees` SET `password` = '{$password}' WHERE id = {$id}");
return true;
}
开发者ID:acelumaad,项目名称:leave-system,代码行数:7,代码来源:employees_model.php
示例13: addAction
public function addAction()
{
$task = new Todo();
$task->title = $this->request->getPost('title');
$task->description = $this->request->getPost('description');
$task->user_id = getUserId();
$task->save();
$this->dispatcher->forward(['action' => 'index']);
}
开发者ID:Nastia-R,项目名称:invo,代码行数:9,代码来源:TodoController.php
示例14: addReport
/**
* 新增测试报告
* @param 测试用例id $caseId
* @return 新增数据的id
*/
public function addReport($objId, $type, $prid = -1)
{
$data['objId'] = $objId;
$data['userId'] = getUserId();
$data['status'] = ReportModel::RUNNING;
$data['type'] = $type;
$data['prid'] = $prid;
return $this->add($data);
}
开发者ID:john1688,项目名称:BAT,代码行数:14,代码来源:ReportModel.class.php
示例15: indexAction
public function indexAction()
{
$this->loadModel("ClickModel");
$model = new ClickModel();
$top_stats = $model->dashboardTopStats(getUserId());
$this->setVar("title", "Dashboard");
$this->setVar("top_stats", $top_stats);
$this->render("dashboard/dashboard");
}
开发者ID:sakibanda,项目名称:ballistic-tracking,代码行数:9,代码来源:DashboardController.php
示例16: showInformesDirectores
function showInformesDirectores() {
$params = array(":idusuario" => getUserId());
$sql =
"SELECT 1
FROM web.wpe_permisosintranet
WHERE pe_idusuario = :idusuario
AND pe_idpagina = 78";
return existeSql($sql, $params);
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:9,代码来源:index.php
示例17: idisplay
protected function idisplay($title)
{
needLogin();
$model = D('User');
$uid = getUserId();
$data = $model->find($uid);
$this->assign("user", $data);
$this->assign("tpname", 'inc:uc_order_' . ACTION_NAME);
$this->display('User:user', $title);
}
开发者ID:yunsite,项目名称:nuomituan,代码行数:10,代码来源:OrderAction.class.php
示例18: conciergeStatus
function conciergeStatus()
{
$status = clearUser();
if ($status === "user cleared.") {
$userId = getUserId($_POST["user"]);
parseInputs($userId);
} else {
echo $status;
}
}
开发者ID:radiochickenwax,项目名称:gregsList,代码行数:10,代码来源:butler.php
示例19: isUserLoggedIn
function isUserLoggedIn()
{
$userId = getUserId();
if ($userId != -1) {
$account = DB::queryFirstRow("SELECT Id, Status FROM CWM_User WHERE Id=%?", $userId);
$uidHashFromServer = sha1($account['Id']);
$uidHash = getUserIdHash();
return isset($uidHash) && $uidHashFromServer == $uidHash && !is_null($account) && $account['Status'] == 1;
}
return false;
}
开发者ID:mahuidong,项目名称:CodeWithMe,代码行数:11,代码来源:auth.inc.php
示例20: _buildQuery
function _buildQuery()
{
$query = DBModel::getInstance();
$query->reset('UserSettings');
$query->setQualifier('userid', 'equals', getUserId());
$query->setQualifier('name', 'equals', $this->name, false);
if (isset($this->value)) {
$query->setAttribute('value', $this->value, true);
}
return $query;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:11,代码来源:Textcube.Data.UserSetting.php
注:本文中的getUserId函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论