Beispiel #1
0
 public function setContent($html)
 {
     if (\app::getClass('user')->VerifyConnexion() && $_SESSION['permissions'] & 128) {
         /* perm 128 = configure blocks */
         return \tools::file_put_contents(PROFILE_PATH . $this->getConfig('viewPath'), \tools::sanitize($html));
     }
     return FALSE;
 }
Beispiel #2
0
 public function setContent($fileName)
 {
     if (\app::getClass('user')->VerifyConnexion() && $_SESSION['permissions'] & 128) {
         /* perm 128 = configure blocks */
         $this->setConfig('imgPath', $fileName);
         return TRUE;
     }
     return FALSE;
 }
Beispiel #3
0
                            ?>
</div>
											<!-- NESTED COMMENTS ANSWER -->
								</li>
							<?php 
                        }
                        ?>
						<?php 
                    }
                    ?>
					</ul>
					<?php 
                    // if config provides that user must me connected
                    if ($configs['loggedin'] == "1") {
                        // check if user connected
                        if (\app::getClass('user')->VerifyConnexion()) {
                            // Post a comment
                            ?>
							<h4 class="title"><?php 
                            echo t('Post a comment');
                            ?>
</h4>

							<?php 
                            // Tpl: Login as & comment form
                            ?>
							<div class="userInfo">
								<?php 
                            echo t('Connected as') . ' <span>' . \app::$request->getParam('session_login') . '</span>';
                            ?>
								(<a class="logout" href="logout"><?php 
Beispiel #4
0
 public function renewPassAction()
 {
     $mail = \app::$request->getParam('mail');
     if ($mail !== FALSE && filter_var($mail, FILTER_VALIDATE_EMAIL)) {
         return \app::getClass('user')->resetPassword(filter_var($mail, FILTER_VALIDATE_EMAIL));
     } else {
         return t('Invalid E-mail');
     }
 }
Beispiel #5
0
    CFInstall.check({
        mode: "inline", // the default
        oninstall: function(){
            alert("Chrome Frame is now installed. Restart your browser to start enjoying Parsimony!");
        }
    });
    });
</script>
<![endif]-->
<?php 
if (\app::getClass('user')->VerifyConnexion()) {
    header('Location: ' . BASE_PATH . 'index');
    exit;
}
if (isset($_POST['connexion'])) {
    $user = \app::getClass('user');
    $user->authentication($_POST['login'], $_POST['password']);
    if ($user->VerifyConnexion()) {
        header('Location: ' . BASE_PATH);
        exit;
    } else {
        echo '<div id="wrong">' . t('The username or password you entered is incorrect') . '</div>';
    }
}
?>
<!DOCTYPE html> 
<html> 
    <head> 
        <title><?php 
echo t('Login');
?>
Beispiel #6
0
 /**
  * Determine Role & permissions
  */
 protected function determineRole()
 {
     /* Rights */
     define('DISPLAY', 1);
     define('INSERT', 2);
     define('UPDATE', 4);
     define('DELETE', 8);
     if (\app::getClass('user')->VerifyConnexion() === TRUE && (empty(app::$config['security']['allowedipadmin']) || preg_match('@' . preg_quote($_SERVER['REMOTE_ADDR'], '.') . '@', app::$config['security']['allowedipadmin']))) {
         /* Mainly to use in query block, session_ prefix to avoid collision */
         $this->setParams(array('session_id_user' => $_SESSION['id_user'], 'session_id_role' => $_SESSION['id_role'], 'session_permissions' => $_SESSION['permissions'], 'session_login' => $_SESSION['login']));
         if ($_SESSION['permissions'] > 0) {
             /* If user is a creator we display errors and active admin module */
             \app::$activeModules['admin'] = 1;
             error_reporting(-1);
             ini_set('display_errors', 1);
             set_error_handler('\\core\\classes\\app::errorHandler');
             set_exception_handler('\\core\\classes\\app::exceptionHandler');
             register_shutdown_function('\\core\\classes\\app::errorHandlerFatal');
         }
     } else {
         $_SESSION['permissions'] = 0;
         $_SESSION['id_role'] = 4;
         /* Mainly to use in query block */
         $this->setParams(array('session_id_user' => FALSE, 'session_id_role' => 4, 'session_permissions' => 0, 'session_login' => FALSE));
     }
     define('TOKEN', $_SESSION['TOKEN']);
 }