本文整理汇总了PHP中SessionManager::getCurrentUser方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionManager::getCurrentUser方法的具体用法?PHP SessionManager::getCurrentUser怎么用?PHP SessionManager::getCurrentUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionManager
的用法示例。
在下文中一共展示了SessionManager::getCurrentUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addChangesLogs
/**
* Insert one changes logs to the database
*
* @author Jonathan Sandoval <jonathan_s_pisis@yahoo.com.mx>
* @param String $typéChange The type of the change to efect (insert, update, delete)
* @param String $descriptionC The description of the change
* @return boolean If was posible to insert the data
*/
static function addChangesLogs($typeChange = "", $descriptionC = "")
{
if ($typeChange == "") {
return false;
}
$date = time();
$user = SessionManager::getCurrentUser();
if ($user === NULL) {
return false;
}
$idUser = $user->getId();
$tableChangesLogs = DatabaseManager::getNameTable('TABLE_CHANGES_LOGS');
$query = "INSERT INTO {$tableChangesLogs}\r\n (date, idUser, type, description) \r\n VALUES \r\n ({$date}, {$idUser}, '{$typeChange}', '{$descriptionC}')";
return DatabaseManager::singleAffectedRow($query);
}
示例2: BaptismCertificate
<?php
require_once __DIR__ . "/../../../Backend/Certs/BaptismCertificate.php";
SessionManager::validateUserInPage('baptismLook.php');
if (isset($_GET) && $_GET["idBaptism"] !== NULL && isset($_SESSION) && $_SESSION["user_id"] !== NULL) {
$user = SessionManager::getCurrentUser();
$pdf = new BaptismCertificate($user->getId(), $_GET["idBaptism"], $_GET["full"]);
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->displayData();
$pdf->Output();
} else {
echo "<script>\n url = String(window.location);\n url = url.substr(0, url.indexOf('cert'));\n window.location.href = url + 'main.php';\n </script>";
}
示例3: file_get_contents
<?php
require_once __DIR__ . "/../../Backend/SessionManager.php";
require_once __DIR__ . "/../../Backend/BibleQuote.php";
require_once __DIR__ . "/../../Backend/LanguageSupport.php";
SessionManager::validateUserInPage('main.php');
//Get File contest from template
$string = file_get_contents("template/Main.html");
$string = str_replace("|biblic|", BibleQuote::randomQuote(), $string);
//Remplace the nav
$user_name = strtoupper(SessionManager::getCurrentUser()->getUsername());
$string = str_replace("Username", $user_name, $string);
//Remplace the nav
$string = str_replace("|NavBar|", SessionManager::getNavBar(), $string);
//Display the page
$string = LanguageSupport::HTMLEvalLanguage($string);
echo $string;