PHP User::generateLoginState Examples

PHP User::generateLoginState - 8 examples found. These are the top rated real world PHP examples of User::generateLoginState extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
<?php

require_once "models/User.php";
require_once "views/Standard.php";
require_once "views/Support.php";
echo Standard::render(Support::getBar(), Support::getText(), User::generateLoginState());
Example #2
0
<?php

require_once 'models/Http.php';
require_once 'models/User.php';
require_once 'views/Standard.php';
require_once 'views/UploadPage.php';
$notice = '';
if (Http::has('newid')) {
    $notice = UploadPage::renderSuccess(Http::get('newid'));
} else {
    if (Http::has('reason')) {
        $notice = UploadPage::renderFail(Http::get('reason'));
    }
}
$upload_form = UploadPage::render(Http::get('description'), Http::get('taglist'), Http::get('newid'), Http::get('autolink'));
echo Standard::render(UploadPage::renderInformation($notice), $upload_form, User::generateLoginState());
Example #3
0
<?php

require_once 'models/Http.php';
require_once "models/Media.php";
require_once "models/User.php";
require_once "views/Thumbnail.php";
require_once "views/Standard.php";
$page = Http::getOrOne('page') - 1;
$media = new Media();
$results = $media->getPage([], $page, 25);
$html = Thumbnail::generateThumbnails($results['media']);
$html .= Thumbnail::generatePageCounter($results['pagecount'], $page);
$sidebar = Standard::renderSidebar();
echo Standard::render($sidebar, $html, User::generateLoginState());
Example #4
0
<?php

require_once 'models/Http.php';
require_once 'models/Media.php';
require_once 'models/User.php';
require_once 'views/SearchError.php';
require_once 'views/Standard.php';
require_once 'views/Thumbnail.php';
$page = Http::getOrOne('page') - 1;
$media = new Media();
$tags = explode(' ', trim(Http::get('tags')));
$result = $media->getPage($tags, $page, 25);
$html = Thumbnail::generateThumbnails($result['media']);
$html .= Thumbnail::generatePageCounter($result['pagecount'], $page, 'search/', Http::get('tags'));
$error = SearchError::maybeWriteError($result['unused']);
$sidebar = Standard::renderSidebar();
echo Standard::render($error . $sidebar, $html, User::generateLoginState(), Http::get('tags'));
Example #5
0
<?php

require_once 'models/Http.php';
require_once 'models/Media.php';
require_once 'models/User.php';
require_once 'views/MediaPage.php';
require_once 'views/Standard.php';
$media = new Media();
$media_id = Http::get('id');
$comments = $media->getComments($media_id, 0, 50);
$media_tags = $media->getAllTags($media_id);
$media_data = $media->getMedia($media_id);
$statistics = $media->getMediaStatistics($media_id);
$user = User::getUser(User::getCurrentLogin());
$user_affiliation = $media->getUserVotes($media_id, $user['user_ID']);
$media_code = MediaPage::render($media_data, $media_tags, $comments);
$from = $media_data['from_id'];
$to = $media_data['to_id'];
$control_code = MediaPage::renderControls($media_data['media_ID'], $user_affiliation, $statistics, $from, $to);
$error_code = MediaPage::renderWarning(Http::get('reason'));
echo Standard::render($control_code . $error_code, $media_code, User::generateLoginState());
Example #6
0
<?php

require_once 'models/Http.php';
require_once 'models/User.php';
require_once 'views/Standard.php';
require_once 'views/Register.php';
$username = Http::get('username');
$email = Http::get('email');
$register_form = Register::render($username, $email);
$reason = Register::renderReason(Http::get('reason'));
$information = Register::renderInformation();
echo Standard::render($information . $reason, $register_form, User::generateLoginState());
Example #7
0
$username = Http::get('name');
$logged_in_as = User::getCurrentLogin();
$viewerinfo = User::getUser($logged_in_as);
$userinfo = User::getUser($username);
if ($viewerinfo == false) {
    $error = Userpage::renderNoPrivilege($username);
    echo Standard::render('', $error);
    die;
}
if ($userinfo == false) {
    $error = Userpage::renderNotExist($username);
    echo Standard::render('', $error);
    die;
}
if ($username == $logged_in_as || $userinfo['privilege'] > $viewerinfo['privilege'] && $viewerinfo['privilege'] <= 4) {
    $privilege = Userpage::renderPrivileged($username, $userinfo['email'], $privileges, $userinfo['privilege'], $viewerinfo['privilege'], $viewerinfo['username']);
    $sidebar = Userpage::renderPrivilegedStatistics();
    $sidebar .= Userpage::renderReason(Http::get('reason'));
    if (Http::get('reason') == 'success') {
        $sidebar .= Userpage::renderSuccessTime(Http::get('time'));
    } else {
        if (Http::get('reason') == 'nothing_changed') {
            $sidebar .= Userpage::renderNothingChanged();
        }
    }
    echo Standard::render($sidebar, $privilege, User::generateLoginState());
} else {
    $error = Userpage::renderNoPrivilege($username);
    echo Standard::render('', $error);
    die;
}
Example #8
0
<?php

require_once 'models/Media.php';
require_once 'models/User.php';
require_once 'views/Standard.php';
require_once 'views/Tag.php';
$media = new Media();
$tags = $media->getAllTagsGloballyByCount();
$taghtml = Tag::render($tags);
echo Standard::render('Here you can see the most common tags in the database. Any non-whitespace broken sequence of characters constitutes a single tag. The number in the parentheses represent the amount of media that is tagged with that tag. If tags have the same number of media, then they will be sorted alphabetically.', $taghtml, User::generateLoginState());