本文整理汇总了PHP中auth::getUid方法的典型用法代码示例。如果您正苦于以下问题:PHP auth::getUid方法的具体用法?PHP auth::getUid怎么用?PHP auth::getUid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auth
的用法示例。
在下文中一共展示了auth::getUid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertLogRow
function insertLogRow($type, $text, $submitter = "")
{
if (!IS_TESTSERVER && isInPath("preprints_test")) {
return FALSE;
}
if (empty($type)) {
return FALSE;
}
// ----------------------
$uid = !empty(auth::getUid()) ? auth::getUid() : PP_ROBOT_UID;
$sql = "INSERT INTO " . $this->dbprefix . PP_LOGTABLE . " (type,time,uid,text,ip) " . "VALUES " . " (" . " '" . addslashes(strip_tags($type)) . "'," . " '" . time() . "'," . " '" . $uid . "'," . " '" . addslashes(strip_tags($text . " " . $submitter)) . "'," . " '" . addslashes($_SERVER["REMOTE_ADDR"]) . "'" . " )";
$res = (bool) $this->query($sql, IS_TESTSERVER);
// includes a call to connect
// ----------------------
return $res ? $this->insert_id() : FALSE;
}
示例2: mail_preprint_prettyprinted
public static function mail_preprint_prettyprinted($row, $owner, $pp, $action)
{
$uid = !empty(auth::getUid()) ? auth::getUid() : PP_ROBOT_UID;
$url = "http://" . $_SERVER["REMOTE_ADDR"] . (preg_match("#/\$#i", $_SERVER["PHP_SELF"]) ? $_SERVER["PHP_SELF"] : dirname($_SERVER["PHP_SELF"])) . "/?selectPP=" . $row["rowid"];
$date = strtolower($action) != "deleted" ? date("Y-m-d G:i", $row["tm"]) : "";
$tit = strtolower($action) == "reminder" ? "Preprint " . $row["status"] . " " . $date . " (" . functions::deltaTime(time(), (int) $row["tm"]) . " ago) but has not being completed yet.\n\n" . "URL: " . $url : "Preprint " . $action . " " . $date;
return $tit . "\r\n" . "Number: " . $pp . "\r\n" . "Field: " . self::$researchFields[$row["field"]] . "\r\n" . "Owner: " . $owner . "\r\n" . "Title: " . $row["title"] . "\r\n" . "Authors: " . $row["authors"] . "\r\n" . $action . " by " . auth::getGecos($uid);
}