]> dev.renevier.net Git - syp.git/blobdiff - inc/templates_admin.php
web interface to add co-administrators
[syp.git] / inc / templates_admin.php
index 814ca4566c362a5473478a46ebbe4c23fc981228..90bdb52970d60d3fcb1449257395b90f932071d4 100644 (file)
@@ -2,11 +2,14 @@
 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
    license. */
 
-require_once ("./inc/settings.php");
+$error = false;
+
+if (!@include_once ("./inc/settings.php")) {
+    $error = true;
+}
 require_once ("./inc/db/mysql.php");
 require_once ("./inc/utils.php");
 
-$error = false;
 try {
     $connection->connect (DBHOST, DBUSER, DBPWD, DBNAME, DBPREFIX);
     $usrtblexists = $connection->users_table_exists ();
@@ -29,7 +32,7 @@ if (!$usrtblexists || !$itemstblexists) {
 </head>
 <body>
     <p class="error center"><?php ptrans('SYP is not correctly installed. Please follow README.txt instructions
-       and go to <a href="wizard.en.php">wizard</a>.')?></p>
+       and go to <a href="install.en.php">wizard</a>.')?></p>
 </body>
 </html>
 <?php
@@ -64,9 +67,12 @@ 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.')?>",
-            UnknownError: "<?php ptrans('There was an unknown error.')?>",
             DelSucces: "<?php ptrans('Removal took place correctly.')?>",
-            UpdateSucces: "<?php ptrans('Save took place correctly.')?>"
+            UpdateSucces: "<?php ptrans('Save took place correctly.')?>",
+            newUserNonameError: "<?php ptrans('User name has not been set.')?>",
+            newUserPasswordmatchError: "<?php ptrans('Passwords do not match.')?>",
+            newUserExistsError: "<?php ptrans('User already exists in database.')?>",
+            newUserSuccess: "<?php ptrans('User added correctly.')?>"
         };
 
         var sypSettings =  {
@@ -96,7 +102,35 @@ if (!$usrtblexists || !$itemstblexists) {
 
     <div id="header">
     <?php other_languages($lang) ?>
-    <p id="logout"><a href="logout.php"><?php ptrans('Logout')?></a></p>
+    <div id="user_management">
+        <p id="logout"><a href="logout.php"><?php ptrans('Logout')?></a></p>
+        <p id="add_user"><a href=""><?php ptrans('Add a co-administrator')?></a></p>
+    </div>
+        <div id="newuser_area">
+            <input id="newuser_close" type="image" src="openlayers/theme/default/img/close.gif"
+                        title="<?php ptrans('close without saving')?>" alt="<?php ptrans('close')?>">
+            <form id="newuser" method="post">
+                <label for="newuser_name"><?php ptrans('user name:')?></label>
+                <br>
+                <input id="newuser_name" name="newuser_name">
+                <br>
+                <label for="newuser_password"><?php ptrans('user password:')?></label>
+                <br>
+                <input id="newuser_password" name="newuser_password" type="password" value="">
+                <br>
+                <label for="newuser_password_confirm"><?php ptrans('confirm password:')?></label>
+                <br>
+                <input id="newuser_password_confirm" name="newuser_password_confirm" type="password">
+                <br>
+                <input id="newuser_submit" name="newuser_submit" type="submit" value="<?php ptrans('Validate user')?>">
+                <input type="hidden" name="request" value="newuser">
+                </form>
+                <p id="newuser_comm" class="center"></p>
+                <p id="newuser_throbber" class="throbber center">
+                    <?php ptrans('Connecting')?>
+                    <img src="media/newuser-throbber.gif">
+                </p>
+        </div>
     </div>