當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SessionManager::getCurrentUser方法代碼示例

本文整理匯總了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);
 }
開發者ID:jonatalamantes,項目名稱:NotariusAdOmnes,代碼行數:23,代碼來源:ChangesLogsManager.php

示例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>";
}
開發者ID:jonatalamantes,項目名稱:NotariusAdOmnes,代碼行數:14,代碼來源:baptismCert.php

示例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;
開發者ID:jonatalamantes,項目名稱:NotariusAdOmnes,代碼行數:17,代碼來源:main.php


注:本文中的SessionManager::getCurrentUser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。