本文整理汇总了PHP中getCurrentTime函数的典型用法代码示例。如果您正苦于以下问题:PHP getCurrentTime函数的具体用法?PHP getCurrentTime怎么用?PHP getCurrentTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCurrentTime函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: txTest
/**
* 测试事务
*/
public function txTest()
{
$d = D();
//开始事务
$d->begin();
try {
$now = getCurrentTime();
//添加用户
$m = M("user");
$ud = array("mobile" => "1" . time(), "created" => $now);
$id = $m->add($ud);
//添加用户资料
$m = M("user_profile");
$profile = array("name" => "闵益飞" . $id, "user_id" => $id, "age" => 20, 'created' => $now, 'updated' => $now);
$m->add($profile);
//通过sql形式读取用户资料
$sql = "select a.mobile,b.name,b.age from user a,user_profile b where a.id=b.user_id";
$datas = $d->findSql($sql);
//如果没问题事务提交
$d->commit();
var_dump($datas);
} catch (Exception $e) {
//如果报错 事务回滚
$d->rollBack();
var_dump($e);
}
}
开发者ID:Honvid,项目名称:HCMS,代码行数:30,代码来源:DatabaseController.php
示例2: showScripttime
function showScripttime()
{
global $scriptTimeStart;
$scriptTimeEnd = getCurrentTime();
$scriptTimeDiv = intval(($scriptTimeEnd - $scriptTimeStart) * 1000) / 1000;
return $scriptTimeDiv;
}
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:7,代码来源:function_showmicrotime.inc.php
示例3: searchEngine
/**
* 敏感分析服务
*
* @return void
*/
function searchEngine($data, $runtime = false)
{
$process_start_time = getCurrentTime();
$result = post(X::getConfigVar("searchEngine"), ["words" => cleanFormat($data['content']), 'if_spam' => $data['if_spam']]);
$process_end_time = getCurrentTime();
if ($runtime) {
$process_time = round($process_end_time - $process_start_time, 4);
//运行时间
return [$result, $process_time];
}
return $result;
}
开发者ID:sdgdsffdsfff,项目名称:marvel,代码行数:17,代码来源:post.php
示例4: BuildOCPSoap
function BuildOCPSoap()
{
/*
Select the right region for your CRM
crmna:dynamics.com - North America
crmemea:dynamics.com - Europe, the Middle East and Africa
crmapac:dynamics.com - Asia Pacific
*/
$region = 'crmapac:dynamics.com';
$OCPRequest = '<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</a:Action>
<a:MessageID>urn:uuid:%s</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">%s</a:To>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="_0">
<u:Created>%sZ</u:Created>
<u:Expires>%sZ</u:Expires>
</u:Timestamp>
<o:UsernameToken u:Id="uuid-cdb639e6-f9b0-4c01-b454-0fe244de73af-1">
<o:Username>%s</o:Username>
<o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">%s</o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
<s:Body>
<t:RequestSecurityToken xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust">
<wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<a:EndpointReference>
<a:Address>' . $region . '</a:Address>
</a:EndpointReference>
</wsp:AppliesTo>
<t:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</t:RequestType>
</t:RequestSecurityToken>
</s:Body>
</s:Envelope>';
$OCPRequest = sprintf($OCPRequest, gen_uuid(), 'https://login.microsoftonline.com/RST2.srf', getCurrentTime(), getNextDayTime(), $this->username, $this->password);
return $OCPRequest;
}
开发者ID:kgatjens,项目名称:crm-php,代码行数:42,代码来源:authentication.php
示例5: process
public function process()
{
try {
$oTableOperate = new SingleTableOperation('cUser', "MYZL");
$data = $oTableOperate->getObject(array('userId' => $this->_args['userId']));
if (count($data)) {
$this->_retValue = EC_RECORD_EXIST;
$this->_retMsg = "user already exist!";
interface_log(ERROR, $this->_retValue, $this->_retMsg);
return false;
}
//添加用户记录,设置相关的字段,这里可以根据自己的策略设置
$oTableOperate->addObject(array('userId' => $this->_args['userId'], 'password' => $this->_args['password'], 'email' => $this->_args['email'], 'money' => 100, 'bulletNum' => 5, 'xsft' => 5, 'hdcx' => 5, 'chxs' => 5, 'sszm' => 5, 'addTimeStamp' => getCurrentTime()));
$this->_responseText = MYZL_HINT_ADDUSER_SUC;
} catch (DB_Exception $e) {
$errorNum = $oTableOperate->getErrorNum();
$this->_retMsg = $oTableOperate->getErrorInfo() . $e->getMessage();
$this->_retValue = genRetCode($errorNum);
interface_log(ERROR, $this->_retValue, $this->_retMsg);
return false;
}
return true;
}
开发者ID:bsdcfp,项目名称:wxmp,代码行数:23,代码来源:AddUser.php
示例6: phpexcel
public function phpexcel()
{
require_once APP_SITE_PATH . '/plugins/phpexcel/PHPExcel.php';
$title = "MyfMvc";
$objPHPExcel = new PHPExcel();
$objPHPExcel->getProperties()->setCreator("myf")->setLastModifiedBy("minyifei.cn")->setTitle($title)->setSubject($title)->setDescription($title)->setKeywords($title)->setCategory($title);
//设置excel的表头
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', '编号')->setCellValue('B1', '手机号')->setCellValue('C1', '姓名')->setCellValue('D1', '创建时间');
$objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1, 1);
$index = 2;
for ($i = 1; $i <= 9; $i++) {
$id = $i;
$mobile = "1371760000" . $i;
$name = "mvc" . $i;
$time = getCurrentTime();
$objPHPExcel->getActiveSheet()->setCellValue('A' . $index, $id)->setCellValue('B' . $index, $mobile)->setCellValue('C' . $index, $name)->setCellValue('D' . $index, $time);
$index++;
}
$objPHPExcel->getActiveSheet()->setTitle("客户统计");
$objPHPExcel->setActiveSheetIndex(0);
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="' . $title . '.xls"');
header('Cache-Control: max-age=0');
header('Cache-Control: max-age=1');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
// Date in the past
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
// always modified
header('Cache-Control: cache, must-revalidate');
// HTTP/1.1
header('Pragma: public');
// HTTP/1.0
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;
}
开发者ID:Honvid,项目名称:HCMS,代码行数:36,代码来源:TestController.php
示例7: ProcessThread
function ProcessThread($threadid, $action, $params = array())
{
$res = null;
$newState = null;
$forExactOperatorMode = false;
$thread = Thread::getInstance()->GetThreadById($threadid);
// without changing state
switch ($action) {
case 'visitor_message':
$res = Thread::getInstance()->PostMessage($threadid, KIND_USER, $params['message'], $params['sendername']);
MapperFactory::getMapper("Thread")->incrementVisitorMessageCount($threadid);
case 'visitor_ping':
$this->ping($thread, $params, 'lastpingvisitor', 'visitortyping');
$thread = Thread::getInstance()->GetThreadById($threadid);
break;
case 'operator_message':
$res = Thread::getInstance()->PostMessage($threadid, KIND_AGENT, $params['message'], $params['sendername'], null, $params['operatorid']);
case 'operator_ping':
case 'operator_force_join':
$this->ping($thread, $params, 'lastpingagent', 'agenttyping');
$thread = Thread::getInstance()->GetThreadById($threadid);
break;
}
switch ($thread["state"]) {
case STATE_INVITE:
switch ($action) {
case 'visitor_ping':
case 'visitor_message':
Thread::getInstance()->PostMessage($threadid, KIND_FOR_AGENT, Resources::Get('client.joined.thread', array(), $thread['locale']));
$newState = STATE_CHATTING;
break;
case "operator_close":
$this->sendOperatorLeft($thread);
$newState = STATE_CLOSED;
break;
case 'operator_ping':
$session = VisitSession::getInstance()->GetVisitSessionById($thread['visitsessionid']);
if (isset($session) && isset($session['updated']) && getCurrentTime() - $session['updated'] > VISITED_PAGE_TIMEOUT) {
Thread::getInstance()->PostMessage($threadid, KIND_FOR_AGENT, Resources::Get('invite.window.closed', array(), $thread['locale']));
$newState = STATE_CLOSED;
}
break;
case 'visitor_invite_close':
Thread::getInstance()->PostMessage($threadid, KIND_FOR_AGENT, $params['message']);
$newState = STATE_CLOSED;
default:
if ($this->isCreatedTimeout($thread, INVITE_ANIMATION_DURATION + 30)) {
// TODO correct timeout
$newState = STATE_CLOSED;
}
}
break;
case STATE_LOADING_FOR_EXACT_OPERATOR:
$forExactOperatorMode = true;
case STATE_LOADING:
switch ($action) {
case 'visitor_ping':
case 'visitor_message':
VisitSession::getInstance()->UpdateVisitSession($thread['visitsessionid'], array('waitmess' => 0));
Thread::getInstance()->PostMessage($threadid, KIND_INFO, Resources::Get('chat.wait', array(), $thread['locale']));
$newState = $forExactOperatorMode ? STATE_QUEUE_EXACT_OPERATOR : STATE_QUEUE;
break;
case "visitor_browser_unload":
$newState = STATE_CLOSED;
break;
case 'operator_join':
case 'operator_force_join':
case 'operator_ping':
case 'operator_message':
$this->joinThreadAndSendMessage($thread, $params['operatorid']);
$newState = STATE_CHATTING;
break;
default:
if ($this->isCreatedTimeout($thread, TIMEOUT_VISITOR_PING)) {
$this->sendVisitorLeft($thread);
$newState = STATE_CLOSED;
}
}
break;
case STATE_QUEUE_EXACT_OPERATOR:
if ($this->isOperatorTimeout($thread, TIMEOUT_EXACT_OPERATOR) || $this->isCreatedTimeout($thread, TIMEOUT_EXACT_OPERATOR)) {
$newState = STATE_QUEUE;
break;
}
case STATE_REDIRECTED:
if ($this->isOperatorTimeout($thread, TIMEOUT_EXACT_OPERATOR)) {
$newState = STATE_QUEUE;
break;
}
case STATE_QUEUE:
switch ($action) {
case 'operator_join':
case 'operator_force_join':
case 'operator_ping':
case 'operator_message':
$this->joinThreadAndSendMessage($thread, $params['operatorid']);
$operators = Operator::getInstance()->getOnlineOperators($params['operatorid']);
$lvm = MapperFactory::getMapper("LostVisitor");
foreach ($operators as $operator) {
$lvm->addLostVisitor($threadid, $operator['operatorid'], $params['operatorid']);
//.........这里部分代码省略.........
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:101,代码来源:class.threadprocessor.php
示例8: BuildVisitorsXml
function BuildVisitorsXml()
{
$xml = array();
// папка online в мэмкэш --------------------
//VisitedPage::GetInstance()->retrieveVisitors();
VisitedPage::GetInstance()->retrieveVisitorsFromMemBuff();
$xml[] = "\n<visitors time=\"" . getCurrentTime() . "000\">";
$alive_visitors = VisitedPage::GetInstance()->getAliveVisitors();
foreach ($alive_visitors as $visitor) {
if (!isset($visitor)) {
continue;
}
$visitor['alive'] = true;
$xml[] = $this->BuildVisitorXml($visitor);
}
$dead_visitors = VisitedPage::GetInstance()->getDeadVisitors();
foreach ($dead_visitors as $visitor) {
if (!isset($visitor)) {
continue;
}
$visitor['alive'] = false;
$xml[] = $this->BuildVisitorXml($visitor);
}
$xml[] = '</visitors>';
return join("\n", $xml);
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:26,代码来源:class.thread.php
示例9: smarty_function_makePromlink
function smarty_function_makePromlink($params, &$smarty)
{
if (empty($params['links'])) {
return '';
}
$result = json_decode($params['links']);
//判断看有没有后门,得到后门的时间戳
function getCurrentTime()
{
$t = $_GET['promlink'];
if (empty($t)) {
return time();
} else {
return parseTime($t);
}
}
//把字符串时间转成时间戳
function parseTime($t)
{
//防止后门输入错误,如果后门输入错误,就使用当前时间
try {
return strtotime(str_replace('_', ' ', $t));
} catch (Exception $e) {
return time();
}
}
function setPromlinkElement($info)
{
$htmlstring = '';
if ($info) {
$htmlstring = '<img src="http://m.baidu.com/static/hb/hot.gif" /><a id="' . $info->id . '" href="' . $info->href . '" style="margin-left:5px;font-size:14px;">' . $info->text . '</a>';
}
return $htmlstring;
}
//取出当天的内容
$currentTime = getCurrentTime();
$currentLinks = array();
//
$pageData = $smarty->getTemplateVars('page');
if (empty($pageData)) {
$pageData = $smarty->getTemplateVars('pageData');
}
$isAndroid = $pageData['isAndroid'];
for ($i = 0, $len = count($result); $i < $len; $i++) {
$promlink = $result[$i];
$startTime = parseTime($promlink->time[0]);
$endTime = parseTime($promlink->time[1]);
if ($currentTime >= $startTime && $currentTime < $endTime) {
if ($isAndroid == 1) {
if (!empty($promlink->android)) {
array_push($currentLinks, $promlink->android);
}
} else {
if (!empty($promlink->ios)) {
array_push($currentLinks, $promlink->ios);
}
}
}
}
$currentLinksLength = count($currentLinks);
if ($currentLinksLength === 0) {
//当天没有
$htmlstring = setPromlinkElement(null);
} else {
if ($currentLinksLength === 1) {
//当天只有一个
$htmlstring = setPromlinkElement($currentLinks[0]);
} else {
//当天有多个,随机显示
$htmlstring = setPromlinkElement($currentLinks[rand(0, $currentLinksLength - 1)]);
}
}
return $htmlstring;
}
开发者ID:drehere,项目名称:shenmegui,代码行数:74,代码来源:function.makePromlink.php
示例10: get
}
//发起get
function get(array $args, $url)
{
// $data = array ('foo' => 'bar');
$data = $args;
$data = http_build_query($data);
$opts = array('http' => array('method' => 'GET', 'timeout' => 60, 'header' => "Accept-language: zh-cn\r\n"));
$context = stream_context_create($opts);
$result = @file_get_contents($url . '?' . $data, false, $context);
return $result;
}
$google_ips = file_get_contents("./bbq_ip.txt");
$_ips = explode("\n", $google_ips);
$all_ip = array();
foreach ($_ips as $ip) {
$_start_coust = getCurrentTime();
$result = get(array('a' => 23), "http://" . $ip);
$_end_coust = round(getCurrentTime() - $_start_coust, 4);
if ($result) {
$all_ip[$ip] = $_end_coust;
} else {
$all_ip[$ip] = 0;
}
}
foreach ($all_ip as $p => $time) {
print $p . "=>" . $time . "\n";
}
// foreach($_ips as $ip){
// }
print "over";
开发者ID:adminrt,项目名称:naer_search,代码行数:31,代码来源:check_google_ips.php
示例11: buildTagsDropDownVersionPlusOne
/**
* Methods to display empty plus one row to allow user the ability to add an additional tag without Plus 'add' icon
* @param $itemList -- a list of selections from the [WEB] Project Deliverable Tags layout
* @param $index -- row number of item being added
* @param $displayList -- A list of tags with description separator of  
*/
function buildTagsDropDownVersionPlusOne($itemList, $index, $displayList)
{
global $log;
$log->debug("deliverableTagFieldBuilder - buildTagsDropDownPlusOneNew() - Running Plus One Time: " . getCurrentTime());
$noTagPkId = "noTagPkId" . "_tv_" . $index;
echo "<select class='tags tagsShowTwoChars' style='width: 40px;' id='" . $noTagPkId . "' name='" . $noTagPkId . "' onchange='processTagChanges(this.id);'>\n";
echo "<option value='' style='width: 160px;'></option>\n";
for ($index = 0; $index < count($itemList); $index++) {
echo "<option value='" . trim($itemList[$index]) . "' style='width: 150px;'>" . trim($displayList[$index]) . "</option>\n";
}
echo "</select>\n";
}
开发者ID:billtucker,项目名称:onweb,代码行数:18,代码来源:deliverableTagFieldBuilder.php
示例12: getCurrentTime_Format
function getCurrentTime_Format($show, $format)
{
$time = getCurrentTime();
$hours = substr($time, -8, 2);
$minutes = substr($time, -5, 2);
$seconds = substr($time, -2);
$pref = "";
if (!$format) {
if ($hours >= 13) {
$hours = $hours - 12;
$pref = " p. m.";
} else {
$pref = " a. m.";
}
}
switch ($show) {
case 'h':
return $hours . $pref;
break;
case 'm':
return $minutes . $pref;
break;
case 's':
return $seconds . $pref;
break;
case 'h:m':
return $hours . ":" . $minutes . $pref;
break;
case 'm:h':
return $minutes . ":" . $hours . $pref;
break;
case 'm:s':
return $minutes . ":" . $seconds . $pref;
break;
case 'h:m:s':
return $hours . ":" . $minutes . ":" . $seconds . $pref;
break;
case 'm:s:h':
return $minutes . ":" . $seconds . ":" . $hours . $pref;
break;
case 's:m:h':
return $seconds . ":" . $minutes . ":" . $hours . $pref;
break;
default:
return $hours . ":" . $minutes . ":" . $seconds;
break;
}
}
开发者ID:Gattoxs,项目名称:100_Ingenieros_dijeron,代码行数:48,代码来源:LDS.php
示例13: doUpdate
/**
* 执行更新操作
*/
public function doUpdate()
{
$data = M("Plan")->create();
$data['caseIds'] = implode(',', $data['caseIds']);
$data['updateTime'] = getCurrentTime();
$ret = M('Plan')->save($data);
if (empty($ret)) {
$this->ajaxReturn(null, '修改测试计划失败', 'success:false');
}
$this->ajaxReturn($ret, '成功', 'success:true');
}
开发者ID:john1688,项目名称:BAT,代码行数:14,代码来源:PlanAction.class.php
示例14: isValidSession
private static function isValidSession($session)
{
return isset($session) && isset($session['visitsessionid']) && isset($session['updated']) && getCurrentTime() - $session['updated'] < VISIT_SESSION_TIMEOUT;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:4,代码来源:class.visitsession.php
示例15: copy
/**
* 用例复制
*/
public function copy()
{
$id = $this->_post('id');
if (empty($id)) {
$this->ajaxReturn(null, '请选择需要复制的用例', 'success:false');
}
$case = D("Case")->relation(true)->getById($id);
unset($case['createTime']);
unset($case['id']);
$case['updateTime'] = getCurrentTime();
$case['userId'] = getUserId();
$case['desc'] = $case['desc'] . "--[复制]";
$steps = array();
foreach ($case['steps'] as $step) {
unset($step['createTime']);
unset($step['id']);
unset($step['caseId']);
$steps[] = $step;
}
$case['steps'] = $steps;
$ret = D("Case")->relation(true)->add($case);
if ($ret === false) {
$this->ajaxReturn(null, '复制用例失败,稍后重试!', 'success:false');
}
$this->ajaxReturn($ret, '成功', 'success:true');
}
开发者ID:john1688,项目名称:BAT,代码行数:29,代码来源:CaseAction.class.php
示例16: date
$tmlPage['formendday'] = date('d', $currTime);
$tmlPage['formendmonth'] = date('m.y', $currTime);
}
}
//
// This function should be defined before it's used otherwise on
// some PHP verions it can fail with Fatal error: Call to undefined function
//
function get_operators_list()
{
$operators = Operator::getInstance()->GetAllAccessedOperators();
$result = array();
$result[''] = Resources::Get('search.any.operator');
if (!empty($operators)) {
foreach ($operators as $op) {
$result[$op['operatorid']] = $op['fullname'];
}
}
return $result;
}
$tmlPage['availableDays'] = range(1, 31);
$currTime = getCurrentTime();
$tmlPage['availableMonth'] = get_month_selection($currTime - 400 * 24 * 60 * 60, $currTime);
$tmlPage['operatorList'] = get_operators_list();
$TML->assign('departments', Operator::getInstance()->enumAvailableDepartmentsForOperator($operator['operatorid'], Resources::getCurrentLocale()));
$TML->assign('locales', getAvailableLocalesForChat());
$tmlPage['show_empty'] = $show_empty;
$TML->assign('page_settings', $tmlPage);
$TML->assign('advanced', true);
$TML->display('thread_search.tpl');
require_once dirname(__FILE__) . '/inc/admin_epilog.php';
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:adv_history.php
示例17: BuildVisitorsXml
public function BuildVisitorsXml()
{
$xml = array();
// папка online в мэмкэш --------------------
//VisitedPage::GetInstance()->retrieveVisitors();
VisitedPage::GetInstance()->retrieveVisitorsFromMemBuff();
$xml[] = "\n<visitors time=\"" . getCurrentTime() . '000">';
$alive_visitors = VisitedPage::GetInstance()->getAliveVisitors();
foreach ($alive_visitors as $visitor) {
if (!isset($visitor)) {
continue;
}
$visitor['alive'] = true;
$xml[] = $this->BuildVisitorXml($visitor);
}
$dead_visitors = VisitedPage::GetInstance()->getDeadVisitors();
foreach ($dead_visitors as $visitor) {
if (!isset($visitor)) {
continue;
}
$visitor['alive'] = false;
$xml[] = $this->BuildVisitorXml($visitor);
}
$xml[] = '</visitors>';
return implode("\n", $xml);
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:26,代码来源:class.thread.php
示例18: startScripttime
function startScripttime()
{
global $scriptTimeStart;
$scriptTimeStart = getCurrentTime();
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:5,代码来源:function_rex_time.inc.php
示例19: array
}
break;
case 'recover':
if (isset($_REQUEST['submitted'])) {
if (empty($_REQUEST['password'])) {
$errors[] = Resources::Get("errors.required", array(Resources::Get('form.field.password')));
}
if ($_REQUEST['password'] != $_REQUEST['password_confirm']) {
$errors[] = Resources::Get('my_settings.error.password_match');
}
if (empty($errors)) {
$o = Operator::getInstance()->GetOperatorByLogin($_REQUEST['login']);
$recoveryTime = $o['recoverytime'];
if (empty($o)) {
$errors[] = Resources::Get("errors.operator_not_found", array(Resources::Get('form.field.login')));
} elseif ($o['recoverytoken'] != $_REQUEST['token'] || getCurrentTime() - $recoveryTime > PASSWORD_RECOVER_TIMEOUT) {
$errors[] = Resources::Get("errors.token_invalid", WEBIM_ROOT . '/operator/recover_password.php?act=send');
}
}
if (empty($errors)) {
$hash['password'] = md5($_REQUEST['password']);
$hash['recoverytoken'] = null;
$hash['recoverytime'] = null;
Operator::getInstance()->UpdateOperator($o['operatorid'], $hash);
Operator::getInstance()->DoLogin($_REQUEST['login'], $_REQUEST['password']);
header('Location: ' . WEBIM_ROOT);
} else {
$TML = new SmartyClass();
setLocaleLinkArguments($TML);
$TML->assign('errors', $errors);
$TML->assign('password', $_REQUEST['password']);
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:recover_password.php
示例20: define
require_once 'classes/class.threadprocessor.php';
require_once 'classes/class.smartyclass.php';
require_once 'classes/class.visitsession.php';
define('AUTOBAN_PERIOD', 20 * 60);
// 20 minutes
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/captcha.php';
$captcha = new captcha();
$theme = Browser::getCurrentTheme();
$thread = tryToGetExistingThread();
if (!isset($_REQUEST['captcha'])) {
$captcha->setNumber();
}
$isBanned = MapperFactory::getMapper('Ban')->isBanned(Browser::GetExtAddr());
$shouldBeBanned = !$isBanned && empty($thread) && is_numeric(Settings::Get('max_sessions')) && Settings::Get('max_sessions') > 0 && MapperFactory::getMapper('Thread')->countOpenThreadsForIP(Browser::GetExtAddr()) + 1 > Settings::Get('max_sessions');
if ($shouldBeBanned) {
$utime = getCurrentTime() + AUTOBAN_PERIOD;
// BAN 24*60*60
$hashTable = array('till' => date('Y-m-d H:i:s', $utime), 'address' => Browser::GetExtAddr(), 'comment' => Resources::Get('ban.autoban.message', Settings::Get('max_sessions')), 'created' => null);
MapperFactory::getMapper('Ban')->save($hashTable);
$isBanned = true;
}
$departmentkey = verify_param('departmentkey', "/^\\w+\$/");
$numberOfOnline = Operator::getInstance()->countOnlineOperators(null, $departmentkey, Resources::getCurrentLocale());
//TODO: write this form departments $departmentkey, Resources::getCurrentLocale());
if ($numberOfOnline == 0 && empty($thread)) {
showLeaveMessagePage();
} elseif ($isBanned) {
displayBanPage();
exit;
} elseif (!empty($thread) && !hasThreadIdParam()) {
sendLocation($thread);
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:client.php
注:本文中的getCurrentTime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论