本文整理汇总了PHP中isUserLoggedIn函数的典型用法代码示例。如果您正苦于以下问题:PHP isUserLoggedIn函数的具体用法?PHP isUserLoggedIn怎么用?PHP isUserLoggedIn使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isUserLoggedIn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _addGrupaMember
function _addGrupaMember()
{
isUserLoggedIn();
$grupa = new Grupa(getdbh());
$checkGroup = $grupa->checkGroupRegistration($_POST['userID']);
if ($checkGroup != false) {
if ($checkGroup['ID_GRUPA'] != $_POST['grupaID']) {
$delete = $grupa->deleteGrupaMember($checkGroup['ID']);
}
}
$check = $grupa->checkRegister($_POST['grupaID'], $_POST['userID']);
if ($check == false) {
$addMember = $grupa->addGrupaMember($_POST['grupaID'], $_POST['userID']);
if ($addMember) {
$data['msg'][] = "Studentul a fost inscris in grupa";
$data['redirect'][] = 'administrare/show_grup';
View::do_dump(VIEW_PATH . 'layout.php', $data);
} else {
$data['msg'][] = "Eroare la inscriere";
$data['redirect'][] = 'administrare/show_grup';
View::do_dump(VIEW_PATH . 'layout.php', $data);
}
} else {
$data['msg'][] = "Studentul este inscris la aceasta grupa";
$data['redirect'][] = 'administrare/show_grup';
View::do_dump(VIEW_PATH . 'layout.php', $data);
}
}
示例2: index
public function index()
{
/*
UserCake (Via CupCake) Version: 2.0.2
http://usercake.com
*/
global $loggedInUser;
$baseURL = getcwd();
require_once "{$baseURL}/application/third_party/user_cake/models/config.php";
if (!securePage($_SERVER['PHP_SELF'])) {
die;
}
//Log the user out
if (isUserLoggedIn()) {
$loggedInUser->userLogOut($this);
}
$s_u = site_url();
if (!empty($s_u)) {
$add_http = "";
if (strpos(site_url(), "http://") === false) {
$add_http = "http://";
}
header("Location: " . $add_http . str_replace('.php', '', site_url()));
die;
} else {
header("Location: http://" . $_SERVER['HTTP_HOST']);
die;
}
}
示例3: authenticateUser
function authenticateUser($redirectUrl)
{
checkSession();
if (!isUserLoggedIn()) {
redirect($redirectUrl);
}
}
示例4: showEventBrief
function showEventBrief($idEvent, $showRelationship = true)
{
if (!isUserLoggedIn()) {
throw new RuntimeException("You need to be logged in.");
}
if (!canSeeEvent($_SESSION["userid"], $idEvent)) {
throw new RuntimeException("You do not have access to this event.");
}
$event = getEvent($idEvent);
$canEdit = isUserLoggedIn() && $event["owner"] === getUserID();
echo '<div class="event_brief" id="event' . $idEvent . '">';
echo '<div class="name"><a href="view_event.php?id=' . $idEvent . '">';
echo '<h2>' . htmlspecialchars($event["name"]) . '</h2>';
echo '</a></div>';
if ($showRelationship) {
if ($canEdit) {
echo '<div class="owner"></div>';
} else {
if (isUserRegisteredInEvent(getUserID(), $idEvent)) {
echo '<div class="registered"></div>';
} else {
echo '<div class="not_registered"></div>';
}
}
}
echo '<img src="database/event_image.php?id=' . $idEvent . '" alt="' . htmlspecialchars($event["name"]) . '" width="64" height="64" />';
echo '<div class="description">';
echo '<p class="description">' . htmlspecialchars($event["description"]) . '</p>';
echo '</div>';
echo '<datetime>' . htmlspecialchars($event["date"]) . '</datetime>';
echo '</div>';
}
示例5: _index
function _index()
{
// $data['msg'][]=View::do_fetch(VIEW_PATH.'login.tpl.php');
// View::do_dump(VIEW_PATH.'layout.php',$data);
isUserLoggedIn();
redirect('news/showNews');
}
示例6: _addMaterii
function _addMaterii()
{
isUserLoggedIn();
$user = new User(getdbh());
$result['profesori'] = $user->fetchByType('profesor');
$data['msg'][] = View::do_fetch(VIEW_PATH . 'addMaterii.tpl.php', $result);
View::do_dump(VIEW_PATH . 'layout.php', $data);
}
示例7: checkLogin
function checkLogin()
{
if (!isUserLoggedIn()) {
echo parseSite("login", array());
return false;
} else {
return true;
}
}
示例8: _show_grup
function _show_grup()
{
isUserLoggedIn();
$grupa = new Grupa(getdbh());
$allGroups = $grupa->fetchAll();
$result['grupa'] = $allGroups;
$data['msg'][] = View::do_fetch(VIEW_PATH . 'afisare_grupa.tpl.php', $result);
View::do_dump(VIEW_PATH . 'layout.php', $data);
}
示例9: _show_users
function _show_users()
{
isUserLoggedIn();
$user = new User(getdbh());
$user_details = $user->fetchAll();
$result['user'] = $user_details;
$data['msg'][] = View::do_fetch(VIEW_PATH . 'afisare_user.tpl.php', $result);
View::do_dump(VIEW_PATH . 'layout.php', $data);
}
示例10: _addTemaView
function _addTemaView()
{
isUserLoggedIn();
if (getUserType() == 'profesor') {
$grupa = new Grupa(getdbh());
$result['grupa'] = $grupa->fetchAll();
$data['msg'][] = View::do_fetch(VIEW_PATH . 'addTema.tpl.php', $result);
View::do_dump(VIEW_PATH . 'layout.php', $data);
}
}
示例11: _showGrupaDetails
function _showGrupaDetails($id = 0, $numeGrupa = '')
{
isUserLoggedIn();
$grupa = new Grupa(getdbh());
$result['users'] = $grupa->fetchGrupaUsers($id);
$result['nume'] = $numeGrupa;
$result['id'] = $id;
$data['msg'][] = View::do_fetch(VIEW_PATH . 'showGrupaDetails.tpl.php', $result);
View::do_dump(VIEW_PATH . 'layout.php', $data);
}
示例12: _addGrupaUsers
function _addGrupaUsers($id = 0)
{
isUserLoggedIn();
$user = new User(getdbh());
$getUsers = $user->fetchAll();
$result['user'] = $getUsers;
$result['grupaID'] = $id;
$data['msg'][] = View::do_fetch(VIEW_PATH . 'addUserGrupa.tpl.php', $result);
View::do_dump(VIEW_PATH . 'layout.php', $data);
}
示例13: getReferralPage
function getReferralPage()
{
if (isset($_SESSION['referral_page'])) {
return $_SESSION['referral_page'];
} else {
if (isUserLoggedIn()) {
return ACCOUNT_ROOT;
} else {
return SITE_ROOT;
}
}
}
示例14: updateUserPick
function updateUserPick($pick = NULL, $pool = NULL)
{
global $loggedInUser, $db, $db_table_prefix;
if (isUserLoggedIn()) {
$round = json_decode($this->getCurrentRound())->round;
$sql = "UPDATE " . $db_table_prefix . "pool" . $pool . " SET pick = '" . $pick . "' WHERE \n\t\t\tuserId = " . $loggedInUser->user_id . " AND\n\t\t\troundPicked = '" . $round . "'";
$picks = $db->sql_query($sql);
var_dump($picks);
return '{"success": ' . json_encode($picks) . '}';
}
return false;
}
示例15: generate
public static function generate($_asJson = true)
{
$result = array();
$publicKey = sha1(mt_rand_str(40));
$privateKey = sha1(mt_rand_str(40));
#if(CWM_API::IsTokenValid($tokenValue)) {
if (isUserLoggedIn()) {
$result = array('public' => $publicKey, 'private' => $privateKey);
}
if ($_asJson) {
$result = CWM_API::getAsJson($result);
}
return $result;
}