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


PHP fAuthorization::getUserToken方法代码示例

本文整理汇总了PHP中fAuthorization::getUserToken方法的典型用法代码示例。如果您正苦于以下问题:PHP fAuthorization::getUserToken方法的具体用法?PHP fAuthorization::getUserToken怎么用?PHP fAuthorization::getUserToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fAuthorization的用法示例。


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

示例1: submit

 public function submit($problem_id)
 {
     try {
         $problem = new Problem($problem_id);
         $language = fRequest::get('language', 'integer');
         if (!array_key_exists($language, static::$languages)) {
             throw new fValidationException('Invalid language.');
         }
         fSession::set('last_language', $language);
         $code = trim(fRequest::get('code', 'string'));
         if (strlen($code) == 0) {
             throw new fValidationException('Code cannot be empty.');
         }
         if ($problem->isSecretNow()) {
             if (!User::can('view-any-problem')) {
                 throw new fAuthorizationException('Problem is secret now. You are not allowed to submit this problem.');
             }
         }
         $record = new Record();
         $record->setOwner(fAuthorization::getUserToken());
         $record->setProblemId($problem->getId());
         $record->setSubmitCode($code);
         $record->setCodeLanguage($language);
         $record->setSubmitDatetime(Util::currentTime());
         $record->setJudgeStatus(JudgeStatus::PENDING);
         $record->setJudgeMessage('Judging... PROB=' . $problem->getId() . ' LANG=' . static::$languages[$language]);
         $record->setVerdict(Verdict::UNKNOWN);
         $record->store();
         Util::redirect('/status');
     } catch (fException $e) {
         fMessaging::create('error', $e->getMessage());
         fMessaging::create('code', '/submit', fRequest::get('code', 'string'));
         Util::redirect("/submit?problem={$problem_id}");
     }
 }
开发者ID:daerduoCarey,项目名称:oj,代码行数:35,代码来源:SubmitController.php

示例2: hasEmailVerified

 public static function hasEmailVerified($username = NULL)
 {
     if ($username === NULL) {
         $username = fAuthorization::getUserToken();
     }
     $email = UserEmail::fetch($username);
     if ($email === NULL) {
         return FALSE;
     }
     return strlen($email) > 0;
 }
开发者ID:daerduoCarey,项目名称:oj,代码行数:11,代码来源:User.php

示例3: allowQuestion

 public function allowQuestion()
 {
     return $this->isRunning() and (User::isSuper() or $this->checkRegistered(fAuthorization::getUserToken()));
 }
开发者ID:daerduoCarey,项目名称:oj,代码行数:4,代码来源:Report.php

示例4:

<?php

include_once __DIR__ . '/inc/init.php';
fAuthorization::requireLoggedIn();
$errmsg = '';
if (fRequest::isPost()) {
    $old_password = fRequest::get('old-password');
    $new_password = fRequest::get('new-password');
    $confirm_password = fRequest::get('confirm-password');
    $token = fAuthorization::getUserToken();
    $username = $token['name'];
    $user_id = $token['id'];
    if (empty($old_password) or empty($new_password) or empty($confirm_password)) {
        $errmsg = '密码不能为空';
    } else {
        if ($new_password != $confirm_password) {
            $errmsg = '两次输入的新密码不一致';
        } else {
            if (login_check_credential($db, $username, $old_password) == false) {
                $errmsg = '旧密码错误';
            } else {
                if (login_change_password($db, $user_id, $new_password)) {
                    fURL::redirect(fSession::delete('change-password-referer', SITE_BASE));
                } else {
                    $errmsg = '修改密码失败';
                }
            }
        }
    }
} else {
    if (fSession::get('change-password-referer') == null) {
开发者ID:daerduoCarey,项目名称:xiaoyou,代码行数:31,代码来源:change-password.php

示例5:

					<th>Item Code</th><th width="300px">Description</th><th>Quantity</th><th>UOM</th><th>Unit Price</th><th>Extended Price</th></tr>
			</thead>
			<tbody>
			</tbody>
			<tfoot>
				<tr><td colspan="5"></td><td>Discount</td><td><input type="text" id="discountRate" value="0.00"></input></td></tr>
				<tr><td colspan="5" id="addRowBTN"><div class="ui-icon ui-icon-circle-plus span-1 last"></div>Add Row</td><td class="tfootCaption">Total</td><td id="purchaseTotal"></td></tr>
			</tfoot>
		</table>
		<div class="pdbox span-11"><label>Payment Terms</label><br /><textarea id="payment" rows="4" cols="10" style="height: 30px; margin-bottom: 20px;"></textarea></div>
		<div class="pdbox span-11"><label>Delivery Terms</label><br /><textarea id="delivery" rows="4" cols="10" style="height: 30px; margin-bottom: 20px;"></textarea></div>
		<div class="pdbox span-11"><label>Special Instructions</label><br /><textarea id="special" rows="4" cols="10" style="height: 30px; margin-bottom: 20px;"></textarea></div>
		<table id="approveContent">
			<tbody>
				<tr>
					<td><label>Requester </label></td><td id="requester"><?php 
echo fAuthorization::getUserToken();
?>
</td><td><label>Date </label><input type="text" id="reqDate" class="datepicker"></input></td>
				</tr>
				<tr style="display: none;">
					<td><label>Approver 1 </label></td><td></td><td><label>Date </label><input type="text" id="app1Date" class="datepicker"></input></td>
				</tr>
			</tbody>
		</table>
		<input type="button" id="submitPOBTN" value="Submit to PO" style="float: left;">
		<input type="button" id="submitBTN" value="Submit" style="float: right;"/>
	</div>
</div>
<?php 
$tmpl->place('footer');
开发者ID:JhunCabas,项目名称:material-management,代码行数:31,代码来源:document-pr.php

示例6:

echo Profile::fetchGrade(fAuthorization::getUserToken());
?>
">
      </div>
    </div>
    <div class="control-group">
      <label class="control-label" for="phone">手机 (必填)</label>
      <div class="controls">
        <input type="text" class="input-medium" id="phone" name="phone" placeholder="手机" value="<?php 
echo Profile::fetchPhoneNumber(fAuthorization::getUserToken());
?>
">
      </div>
    </div>
    <div class="control-group">
      <label class="control-label" for="qq">QQ</label>
      <div class="controls">
        <input type="text" class="input-medium" id="qq" name="qq" placeholder="QQ" value="<?php 
echo Profile::fetchQQ(fAuthorization::getUserToken());
?>
">
      </div>
    </div>
    <div class="form-actions">
      <button type="submit" class="btn btn-success">修改我的个人信息</button>
      <a class="btn" href="javascript:history.go(-1);void(0);">取消</a>
    </div>
  </fieldset>
</form>
<?php 
include __DIR__ . '/../layout/footer.php';
开发者ID:daerduoCarey,项目名称:oj,代码行数:31,代码来源:change_info.php

示例7: elseif

<?php

if (fAuthorization::checkLoggedIn() and Registration::has(fAuthorization::getUserToken(), $this->report->getId())) {
    ?>
  <button class="btn btn-mini btn-success disabled">已确认参赛</button>
<?php 
} elseif ($this->report->isRegistrable()) {
    ?>
  <form style="display:inline;margin:0" action="<?php 
    echo SITE_BASE;
    ?>
/contest/<?php 
    echo $this->report->getId();
    ?>
/register" method="POST">
    <button type="submit" class="btn btn-mini btn-success">确认参赛</button>
  </form>
<?php 
}
开发者ID:daerduoCarey,项目名称:oj,代码行数:19,代码来源:_register_btn.php

示例8: testUserToken

 public function testUserToken()
 {
     $this->assertEquals(NULL, fAuthorization::getUserToken());
     fAuthorization::setUserToken('will@flourishlib.com');
     $this->assertEquals('will@flourishlib.com', fAuthorization::getUserToken());
 }
开发者ID:nurulimamnotes,项目名称:flourish-old,代码行数:6,代码来源:fAuthorizationTest.php

示例9:

</head>
<body>
<div class="container">
	<div id="header" class="span-24 ui-corner-top last">
		<div id="tab1" class="span-3 tab ui-corner-top">
        	<a href="admin-user.php">Admin</a>
        </div>
        <div id="tab2" class="span-3 tab ui-corner-top">
        	<a href="list-pr.php">Document</a>
        </div>
        <div id="tab3" class="span-3 tab ui-corner-top">
        	<a href="inventory.php">Inventory</a>
        </div>
		<div id="tab4" class="span-3 tab ui-corner-top">
        	<a href="report.php">Report</a>
        </div>
		<div id="logintab" class="span-7">
		<?php 
//echo "<p style=\"float: right;\">";
if (fAuthorization::checkLoggedIn()) {
    echo "Welcome " . fAuthorization::getUserToken();
    //echo "<a>Change Password </a>";
    echo " <a href=\"authentication.php?type=logout\">Logout </a>";
    //echo "</p>";
}
?>
		</div>
		<div id="logo" class="go-right span-3 last"></div>
		
	</div>
开发者ID:JhunCabas,项目名称:material-management,代码行数:30,代码来源:menu.php

示例10: checkVericode

 public function checkVericode($id, $vericode)
 {
     try {
         $v = new Vericode($id);
         if ($v->getUsername() != fAuthorization::getUserToken() or $v->getVericode() != $vericode) {
             throw new fValidationException('Invalid verification code.');
         }
         $ue = new UserEmail();
         $ue->setUsername($v->getUsername());
         $ue->setEmail($v->getEmail());
         $ue->store();
         fMessaging::create('success', 'Your email address is verified successfully.');
         $referer = fMessaging::retrieve('referer', SITE_BASE . '/email/verify');
         if ($referer == NULL) {
             $referer = SITE_BASE;
         }
         fURL::redirect($referer);
     } catch (fException $e) {
         fMessaging::create('error', 'Email verification failed: ' . $e->getMessage());
         Util::redirect('/email/verify');
     }
 }
开发者ID:daerduoCarey,项目名称:oj,代码行数:22,代码来源:UserController.php

示例11: catch

            echo "<tr class=\"linkable\"><td class=\"docNumber\">" . $mattran->prepareDocNumber() . "</td>";
            echo "<td>" . $mattran->prepareDocDate("j F Y") . "</td>";
            echo "<td>" . $mattran->prepareRequester() . "</td>";
            echo "<td>" . $fromBranch->prepareName() . "</td>";
            echo "<td>" . $toBranch->prepareName() . "</td>";
            echo "<td>" . $mattran->prepareStatus() . "</td></tr>";
        }
    } catch (fExpectedException $e) {
        echo $e->printMessage();
    }
    ?>
		</tbody>
	</table>
	<?php 
} else {
    $user = new User(fAuthorization::getUserToken());
    ?>
			<h3>List - Attention</h3>
			<table>
				<thead>
					<tr>
						<th>Document Number</th><th>Document Date</th><th>Requester</th>
						<th>from Department</th><th>to Department</th><th>Status</th>
					</tr>
				</thead>
				<tbody>
			<?php 
    try {
        //$mattrans = Material_transfer::findByBranchFrom(10,$user->getBranchId());
        $mattrans = Material_transfer::findByBranchToFro($user->getBranchId(), 20);
        foreach ($mattrans as $mattran) {
开发者ID:JhunCabas,项目名称:material-management,代码行数:31,代码来源:list-mtr.php

示例12: evaluateSession

 /**
  * Master function to evaluate current user's login-ish-ness.
  */
 public static function evaluateSession()
 {
     if (!static::isLoggedIn()) {
         return;
     }
     static::$logged_in = true;
     static::$current_user = fAuthorization::getUserToken();
 }
开发者ID:rizqidjamaluddin,项目名称:Swoosh,代码行数:11,代码来源:sfUsers.php

示例13: newQuestion

 public function newQuestion($id)
 {
     try {
         $report = new Report($id);
         if (!$report->allowQuestion()) {
             throw new fValidationException('Not allowed to ask question.');
         }
         $category = fRequest::get('category', 'integer');
         if ($category == 0) {
             throw new fValidationException('Please choose a category.');
         }
         $question = new Question();
         $question->setUsername(fAuthorization::getUserToken());
         $question->setReportId($report->getId());
         if ($category < 0) {
             $question->setCategory($category);
         } else {
             $question->setCategory(Question::ABOUT_PROBLEM_HIDDEN);
             $problem = new Problem($category);
             $question->setProblemId($problem->getId());
         }
         $question->setAskTime(new fTimestamp());
         $question->setQuestion(trim(fRequest::get('question')));
         if (strlen($question->getQuestion()) < 10) {
             throw new fValidationException('Question too short (minimum 10 bytes).');
         }
         if (strlen($question->getQuestion()) > 500) {
             throw new fValidationException('Question too long (maximum 500 bytes).');
         }
         $question->store();
         fMessaging::create('success', 'Question saved.');
     } catch (fExpectedException $e) {
         fMessaging::create('warning', $e->getMessage());
     } catch (fUnexpectedException $e) {
         fMessaging::create('error', $e->getMessage());
     }
     Util::redirect("/contest/{$id}");
 }
开发者ID:daerduoCarey,项目名称:oj,代码行数:38,代码来源:ReportController.php

示例14: getDisplayName

 public static function getDisplayName()
 {
     $token = fAuthorization::getUserToken();
     return $token['display_name'];
 }
开发者ID:daerduoCarey,项目名称:xiaoyou,代码行数:5,代码来源:UserHelper.php

示例15: isReadable

 public function isReadable()
 {
     return fAuthorization::getUserToken() == $this->getOwner() or User::can('view-any-record');
 }
开发者ID:daerduoCarey,项目名称:oj,代码行数:4,代码来源:Record.php


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