]> git.p6c8.net - jirafeau_mojo42.git/blobdiff - admin.php
[BUGFIX] run session_start before outputing any html
[jirafeau_mojo42.git] / admin.php
index e4321dbce9a59160851608d06908aca88d1a050f..bee8e1f822907939d40ab1ce74c19a9a553e1848 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -16,7 +16,7 @@
  *  You should have received a copy of the GNU Affero General Public License
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
  *  You should have received a copy of the GNU Affero General Public License
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-
+session_start();
 define('JIRAFEAU_ROOT', dirname(__FILE__) . '/');
 
 require(JIRAFEAU_ROOT . 'lib/settings.php');
 define('JIRAFEAU_ROOT', dirname(__FILE__) . '/');
 
 require(JIRAFEAU_ROOT . 'lib/settings.php');
@@ -52,9 +52,6 @@ if (php_sapi_name() == "cli") {
       exit;
   }
 
       exit;
   }
 
-  /* Check session. */
-  session_start();
-
   /* Unlog if asked. */
   if (isset($_POST['action']) && (strcmp($_POST['action'], 'logout') == 0)) {
       $_SESSION['admin_auth'] = false;
   /* Unlog if asked. */
   if (isset($_POST['action']) && (strcmp($_POST['action'], 'logout') == 0)) {
       $_SESSION['admin_auth'] = false;
@@ -78,7 +75,7 @@ if (php_sapi_name() == "cli") {
   elseif ((!isset($_SESSION['admin_auth']) || $_SESSION['admin_auth'] != true)
           && empty($cfg['admin_http_auth_user'])) {
       require(JIRAFEAU_ROOT . 'lib/template/header.php'); ?>
   elseif ((!isset($_SESSION['admin_auth']) || $_SESSION['admin_auth'] != true)
           && empty($cfg['admin_http_auth_user'])) {
       require(JIRAFEAU_ROOT . 'lib/template/header.php'); ?>
-      <form action = "<?php echo basename(__FILE__); ?>" method = "post">
+      <form method="post" class="form login">
       <fieldset>
           <table>
           <tr>
       <fieldset>
           <table>
           <tr>
@@ -138,7 +135,7 @@ if (php_sapi_name() == "cli") {
           ?><div id = "admin">
           <fieldset><legend><?php echo t('Actions'); ?></legend>
           <table>
           ?><div id = "admin">
           <fieldset><legend><?php echo t('Actions'); ?></legend>
           <table>
-          <form action = "<?php echo basename(__FILE__); ?>" method = "post">
+          <form method="post">
           <tr>
               <input type = "hidden" name = "action" value = "clean"/>
               <td class = "info">
           <tr>
               <input type = "hidden" name = "action" value = "clean"/>
               <td class = "info">
@@ -150,7 +147,7 @@ if (php_sapi_name() == "cli") {
               </td>
           </tr>
           </form>
               </td>
           </tr>
           </form>
-          <form action = "<?php echo basename(__FILE__); ?>" method = "post">
+          <form method="post">
           <tr>
               <input type = "hidden" name = "action" value = "clean_async"/>
               <td class = "info">
           <tr>
               <input type = "hidden" name = "action" value = "clean_async"/>
               <td class = "info">
@@ -162,7 +159,7 @@ if (php_sapi_name() == "cli") {
               </td>
           </tr>
           </form>
               </td>
           </tr>
           </form>
-          <form action = "<?php echo basename(__FILE__); ?>" method = "post">
+          <form method="post">
           <tr>
               <input type = "hidden" name = "action" value = "list"/>
               <td class = "info">
           <tr>
               <input type = "hidden" name = "action" value = "list"/>
               <td class = "info">
@@ -174,7 +171,7 @@ if (php_sapi_name() == "cli") {
               </td>
           </tr>
           </form>
               </td>
           </tr>
           </form>
-          <form action = "<?php echo basename(__FILE__); ?>" method = "post">
+          <form method="post">
           <tr>
               <input type = "hidden" name = "action" value = "search_by_name"/>
               <td class = "info">
           <tr>
               <input type = "hidden" name = "action" value = "search_by_name"/>
               <td class = "info">
@@ -188,7 +185,7 @@ if (php_sapi_name() == "cli") {
               </td>
           </tr>
           </form>
               </td>
           </tr>
           </form>
-          <form action = "<?php echo basename(__FILE__); ?>" method = "post">
+          <form method="post">
           <tr>
               <input type = "hidden" name = "action" value = "search_by_file_hash"/>
               <td class = "info">
           <tr>
               <input type = "hidden" name = "action" value = "search_by_file_hash"/>
               <td class = "info">
@@ -202,7 +199,7 @@ if (php_sapi_name() == "cli") {
               </td>
           </tr>
           </form>
               </td>
           </tr>
           </form>
-          <form action = "<?php echo basename(__FILE__); ?>" method = "post">
+          <form method="post">
           <tr>
               <input type = "hidden" name = "action" value = "search_link"/>
               <td class = "info">
           <tr>
               <input type = "hidden" name = "action" value = "search_link"/>
               <td class = "info">
@@ -217,7 +214,7 @@ if (php_sapi_name() == "cli") {
           </tr>
           </form>
           </table>
           </tr>
           </form>
           </table>
-          <form action = "<?php echo basename(__FILE__); ?>" method = "post">
+          <form method="post">
               <input type = "hidden" name = "action" value = "logout" />
               <input type = "submit" value = "<?php echo t('Logout'); ?>" />
           </form>
               <input type = "hidden" name = "action" value = "logout" />
               <input type = "submit" value = "<?php echo t('Logout'); ?>" />
           </form>

patrick-canterino.de