Exemplo n.º 1
0
 public function testSitrouveAdminAvecUnMotDePasseVide_AlorsJAfficheLaPageDeMaintenance()
 {
     global $db, $config, $adminPassword, $adminLogin;
     $resInit = reinitDB();
     $this->assertNotEquals(FALSE, $resInit);
     $db->query("UPDATE " . $config['db']['prefix'] . "users SET password='' where login = '******';");
     $resCheck = $db->checkDB();
     $this->assertEquals(FALSE, $resCheck);
     $page = new page(TRUE);
     $page->prepareHeader(FALSE);
     $resultPage = $page->showPage();
     $template = file_get_contents(dirname(__FILE__) . '/templates/upgradeplz.html');
     $this->assertEquals($template, $resultPage);
     $db->query("UPDATE " . $config['db']['prefix'] . "users SET password='******' where login = '******';");
     $this->assertEquals(false, $resCheck);
 }
Exemplo n.º 2
0
 public function testJAiLIndexParDefaut()
 {
     initLogin();
     $page = new page(TRUE);
     $page->prepareHeader(FALSE);
     $result = $page->showPage();
     $template = file_get_contents(dirname(__FILE__) . '/templates/index_vide_sans_menu.html');
     $this->assertEquals($template, $result);
 }
Exemplo n.º 3
0
<?php

/* 
 * Copyright (C) 2014 saez0pub
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
include_once dirname(__FILE__) . '/../lib/common.php';
$page = new page();
$content = "\n      <div class=row>\n        <div class=\"highlight col-md-3\">\n          <h1>Paramètres</h1>\n        </div>\n        <div class=\"col-md-9\">\n";
$settings = new setting();
$settings->prepare();
$content .= $settings->getTable();
$content .= "\n        </div>\n      </div>\n";
$page->addcontent($content);
$page->showPage();
Exemplo n.º 4
0
 public function testSilMaSessionEstFalse_AlorsJAfficheUnePageDeLogin()
 {
     global $config, $db;
     $oldSession = $_SESSION[$config['sessionName']];
     $_SESSION[$config['sessionName']] = FALSE;
     $page = new page(TRUE);
     $result = $page->showPage();
     $template = file_get_contents(dirname(__FILE__) . '/templates/login.html');
     $_SESSION[$config['sessionName']] = $oldSession;
     $this->assertEquals($template, $result);
 }