]> dev.renevier.net Git - syp.git/blobdiff - inc/html/admin.php
fixes notices
[syp.git] / inc / html / admin.php
index a96a4700db1a356d62f09804d1b3e45dff019fcd..d15846a255b7ed4fe5744c87c07213ca32f5d9f9 100644 (file)
@@ -7,7 +7,7 @@ $error = false;
 if (!@include_once ("./inc/settings.php")) {
     $error = true;
 }
-require_once ("./inc/db/mysql.php");
+require_once ("./inc/db/" . (defined ("DBTYPE")? DBTYPE: "mysql") . ".php");
 require_once ("./inc/utils.php");
 
 try {
@@ -39,8 +39,10 @@ if (!$usrtblexists || !$itemstblexists) {
     exit ();
     } // if ($error)
 
-    $user = $_COOKIE [sprintf ("%suser", DBPREFIX)];
-    $pwd = $_COOKIE [sprintf ("%sauth", DBPREFIX)];
+    $userkey = sprintf ("%suser", DBPREFIX);
+    $user = (isset($_COOKIE [$userkey]))? $_COOKIE[$userkey]: "";
+    $pwdkey = sprintf ("%sauth", DBPREFIX);
+    $pwd = (isset($_COOKIE [$pwdkey]))? $_COOKIE[$pwdkey]: "";
     $logged = ($connection->checkpwdmd5 ($user, $pwd));
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
@@ -53,6 +55,12 @@ if (!$usrtblexists || !$itemstblexists) {
       <link rel="stylesheet" href="./media/admin.css" type="text/css">
       <link rel="stylesheet" href="./openlayers/theme/default/style.css" type="text/css">
 
+<?php
+    if (file_exists ("./media/admin_custom.css")) {
+        printf("    <link rel=\"stylesheet\" href=\"./media/admin_custom.css\" type=\"text/css\">\n");
+    }
+?>
+
       <script type="text/javascript">
         var SypStrings = {
             AddItem: "<?php ptrans('add a place')?>",
@@ -68,16 +76,16 @@ if (!$usrtblexists || !$itemstblexists) {
             UnauthorizedError: "<?php ptrans('Password is not correct.')?>",
             NotimageError: "<?php ptrans('File does not look like an image.')?>",
             UnconsistentError: "<?php ptrans('Server reply was inconsistent.')?>",
-            DelSucces: "<?php ptrans('Removal took place correctly.')?>",
+            DelSucces: "<?php ptrans('Successfully removed.')?>",
             UpdateSucces: "<?php ptrans('Save took place correctly.')?>",
             emptyPasswordError: "<?php ptrans('Password cannot be empty')?>",
             userPasswordmatchError: "<?php ptrans('Passwords do not match.')?>",
             changeSamePass: "<?php ptrans('New password is the same as old password.')?>",
             changePassBadPass: "<?php ptrans('Bad password.')?>",
-            changePassSuccess: "<?php ptrans('Password changed correctly.')?>",
+            changePassSuccess: "<?php ptrans('Password successfully changed.')?>",
             newUserNonameError: "<?php ptrans('User name has not been set.')?>",
             newUserExistsError: "<?php ptrans('User already exists in database.')?>",
-            newUserSuccess: "<?php ptrans('User added correctly.')?>"
+            newUserSuccess: "<?php ptrans('User successfully added.')?>"
         };
 
         var sypSettings =  {
@@ -221,7 +229,7 @@ if (!$usrtblexists || !$itemstblexists) {
                 </tr>
             </table>
             <p class="center">
-                <input id="login_submit" type="submit" value="<?php ptrans('Connection')?>">
+                <input id="login_submit" type="submit" value="<?php ptrans('Login')?>">
                 <input type="hidden" name="request" value="auth">
             </p>
             <p id="pwd_throbber" class="throbber center">