WiClear PHP Cross Reference Collaborative Wikis

Source: /admin/login.php - 105 lines - 3444 bytes - Text - Print

   1  <?php
   2  # ***** BEGIN LICENSE BLOCK *****
   3  # This file is part of WiClear.
   4  # Copyright (c) 2004-2007 David Jobet. All rights
   5  # reserved.
   6  #
   7  # WiClear is free software; you can redistribute it and/or modify
   8  # it under the terms of the GNU General Public License as published by
   9  # the Free Software Foundation; either version 2 of the License, or
  10  # (at your option) any later version.
  11  #
  12  # WiClear is distributed in the hope that it will be useful,
  13  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15  # GNU General Public License for more details.
  16  #
  17  # You should have received a copy of the GNU General Public License
  18  # along with DotClear; if not, write to the Free Software
  19  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
  20  #
  21  # ***** END LICENSE BLOCK *****
  22  
  23  error_reporting(E_ALL);
  24  
  25  $path = dirname(__FILE__).'/../';
  26  // let's use a constant instead of a variable so that hacker can't use it to inject something using a require
  27  // on an unprotected directory
  28  define('wc_inc_path', $path);
  29  unset($path);
  30  
  31  require wc_inc_path.'/inc/classes/util.class.php';
  32  util::sessionWorkaround(wc_inc_path);
  33  
  34  @ini_set('session.use_cookies','1');
  35  @ini_set('session.use_only_cookies','1');
  36  @ini_set('url_rewriter.tags','');
  37  @ini_set('session.use_trans_sid', '0');
  38  session_start();
  39  
  40  require wc_inc_path.'inc/classes/ini.class.php';
  41  require wc_inc_path.'inc/classes/WiclearIni.conf.php';
  42  require wc_inc_path.'inc/classes/auth.class.php';
  43  $ini = new ini(wc_inc_path.'/conf/config.ini');
  44  $ini->importConstants();
  45  
  46  require wc_inc_path.'inc/lib/url.lib.php';
  47  $app_path = createWebAppPath();
  48  $admin_app_path = $app_path.'admin/';
  49  
  50  require wc_inc_path.'inc/lib/variables.lib.php';
  51  $ips = implode(',', auth::getIPs());
  52  setVarSession('login_ips', $ips);
  53  
  54  $random = auth::generateRandomText(255);
  55  setVarSession('login_random', $random);
  56  
  57  setVarSession('login_date', time());
  58  ?>
  59  
  60  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  61    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  62  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
  63    <head>
  64      <meta http-equiv="Content-Type" content="text/html; charset=<?php echo wc_charset;?>"/>
  65      <title><?php echo wc_wiki_name;?> panel admin</title>
  66      <link rel="stylesheet" type="text/css" href="<?php echo $admin_app_path;?>inc/style.css" media="screen"/>
  67    </head>
  68    <body>
  69    <form class="login" action="check_login.php" method="post">
  70    <fieldset>
  71    <legend>Login</legend>
  72    <p class="field">
  73      <label for="flogin">Login</label>
  74      <input type="text" name="login" id="flogin"/>
  75    </p>
  76    <p class="field">
  77      <label for="fpassword">Password</label>
  78      <input type="password" name="password" id="fpasword"/>
  79    </p>
  80    <p class="field">
  81      <input type="hidden" name="check" value="1"/>
  82    </p>
  83    <p class="field">
  84      <input type="hidden" name="ips" value="<?php echo $ips;?>"/>
  85    </p>
  86    <p class="field">
  87      <input type="hidden" name="random" value="<?php echo $random;?>"/>
  88    </p>
  89    <p class="field">
  90      <input class="submit" type="submit" value="Login"/>
  91    </p>
  92    <p class="field"/>
  93    </fieldset>
  94    </form>
  95    <form class="cancel" action="<?php echo $app_path;?>" method="post">
  96    <fieldset>
  97    <legend>Get back to wiki</legend>
  98      <p class="field">
  99        <input class="submit" type ="submit" value="Get back to wiki"/>
 100      </p>
 101      <p class="field"/>
 102    </fieldset>
 103    </form>
 104    </body>
 105  </html>

title

Description

title

Description

title

Description

title

title

Body