user admin page and control
authorPaul J R <me@pjr.cc>
Wed, 26 Sep 2012 22:54:28 +0000 (08:54 +1000)
committerPaul J R <me@pjr.cc>
Wed, 26 Sep 2012 22:54:28 +0000 (08:54 +1000)
gwvpmini/gwvpmini_user.php

index 216c2fb..c495552 100644 (file)
@@ -5,8 +5,9 @@ if($IS_WEB_REQUEST) {
        $reg = gwvpmini_getConfigVal("gravatarenabled");\r
        \r
        $use_gravatar = false;\r
-       if($reg == null) {\r
-               gwvpmini_setConfigVal("gravatarenabled", "1");\r
+       if($reg == null) {
+               // disable grav's by default\r
+               gwvpmini_setConfigVal("gravatarenabled", "0");\r
        } else if($reg == 1) {\r
                $use_gravatar = true;\r
        } else {\r
@@ -74,7 +75,7 @@ function gwvpmini_UserViewPageBody()
                }
        }
        
-       if($isme) {
+       if($isme || gwvpmini_isUserAdmin()) {
                echo "<form method=\"post\" action=\"$BASE_URL/user/updateuserdesc\">";
                echo "Your Description<br><textarea name=\"desc\" cols=\"100\" rows=\"4\">".$dets["desc"]."</textarea><br>";
                echo "<input type=\"submit\" name=\"Update\" value=\"Update\">";
@@ -82,11 +83,19 @@ function gwvpmini_UserViewPageBody()
                
                echo "<h3>New Password</h3>";
                echo "<form method=\"post\" action=\"$BASE_URL/user/updateuserpassword\">";
-               echo "<table><tr><td>Old Password</td><td><input type=\"password\" name=\"oldpassword\"></td></tr>";
+               echo "<table>";
+               if($isme) echo "<tr><td>Old Password</td><td><input type=\"password\" name=\"oldpassword\"></td></tr>";
                echo "<tr><td>New Password</td><td><input type=\"password\" name=\"newpassword1\"></td></tr>";
                echo "<tr><td>Confirm New Password</td><td><input type=\"password\" name=\"newpassword2\"></td></tr></table>";
                echo "<input type=\"submit\" name=\"Update\" value=\"Update\">";
                echo "</form>";
+               
+               echo "<h3>New Email Address</h3>";
+               echo "<form method=\"post\" action=\"$BASE_URL/user/updateuseremail\">";
+               echo "<table><tr><td>New Email Address</td><td><input type=\"password\" name=\"newemail1\"></td></tr>";
+               echo "<tr><td>Confirm New Email Address</td><td><input type=\"password\" name=\"newemail2\"></td></tr></table>";
+               echo "<input type=\"submit\" name=\"Update\" value=\"Update\">";
+               echo "</form>";
        } else {
                echo $dets["desc"]."<br>";
        }