예제 #1
0
파일: Token.php 프로젝트: GIDIX/quicktalk
 public function check($method, $array)
 {
     global $userManager;
     if ($this->check_exception($this->file, $method, $this->env)) {
         return true;
     }
     $token_is_valid = false;
     if (count($array) == 0) {
         $token_is_valid = true;
     }
     if (array_key_exists($this->token_name, $array)) {
         if ($array[$this->token_name] == $this->token) {
             $token_is_valid = true;
         }
     }
     if (!$token_is_valid && $userManager->loggedIn()) {
         echo ErrorMessage::setText('An error occured. Please reload this page.', true);
         //echo 'An error occured. Please reload this page.';
         exit;
     }
     return false;
 }
예제 #2
0
echo '
		<h1>' . $plugin->getTitle() . ' Settings</h1>
	';
$pluginSettings = $plugin->__onCreateSettings();
if (!$pluginSettings instanceof SettingsContainer) {
    echo InfoMessage::setText('This plugin does not have any settings.');
} else {
    $pluginSettingsPreferences = $pluginSettings->__onCreate($plugin, $db);
    if (!is_array($pluginSettingsPreferences) || count($pluginSettingsPreferences) < 1) {
        echo InfoMessage::setText('This plugin does not have any settings.');
    } else {
        if (isset($_POST['submit'])) {
            if ($pluginSettings->__onSave()) {
                echo SuccessMessage::setText('Settings saved.');
            } else {
                echo ErrorMessage::setText('Could not save settings.');
            }
        }
        echo '
				<div class="preferences">
					<form method="post" action="">
						<ul>
			';
        foreach ($pluginSettingsPreferences as $pref) {
            if (!$pref instanceof Preference) {
                continue;
            }
            if ($pref instanceof PreferenceCategory) {
                echo '
						<li class="category">
							<h3>' . $pref->getTitle() . '</h3>
예제 #3
0
파일: index.php 프로젝트: GIDIX/quicktalk
<?php

require '../base.php';
ob_start();
require LANGS . 'ACPDashboardT.php';
ACPDashboardT::init();
require LIB . 'forum/Forum.php';
if (!$userManager->loggedIn() || !$user->isAdmin()) {
    echo ErrorMessage::setText('You are not allowed to view this page.', true);
}
include 'template/header.php';
echo '
		<h1>
			Dashboard
		</h1>

		<section class="statistics">
			<div class="row">
				<div class="item">
					<span>' . Forum::getTotalTopics() . '</span>
					' . ACPDashboardT::get('topics') . '
				</div>

				<div class="item">
					<span>' . Forum::getTotalPosts() . '</span>
					' . ACPDashboardT::get('posts') . '
				</div>

				<div class="item">
					<span>' . User::getTotalUsers() . '</span>
					' . ACPDashboardT::get('members') . '
예제 #4
0
파일: login.php 프로젝트: GIDIX/quicktalk
<?php

Templates::display('header');
?>

	<?php 
if ($errorMessage) {
    ?>
		<?php 
    echo ErrorMessage::setText($errorMessage);
    ?>
	<?php 
}
?>

	<div id="login">
		<h1>Welcome back!</h1>

		<form method="post" action="">
			<input type="text" name="username" placeholder="Username" />
			<input type="password" name="password" placeholder="Password" />

			<input type="submit" name="submit" value="Login" />
		</form>
	</div>

<?php 
Templates::display('footer');
예제 #5
0
<?php

require 'base.php';
require LANGS . 'ForumT.php';
ForumT::init();
$topic = ForumTopic::fromID((int) $_GET['id']);
if (!$topic instanceof ForumTopic) {
    echo ErrorMessage::setText(ForumT::get('topic_doesnt_exist'), true);
}
$forum = $topic->getForum();
$posts = $topic->getPosts(Config::get('max_posts_perpage'), max((int) $_GET['page'], 1));
Templates::assignVars(array('forum' => $forum, 'topic' => $topic, 'posts' => $posts['posts'], 'pages' => $posts['pages']));
PluginHelper::delegate('__onPageDisplay', array($page));
Templates::display('viewtopic');