cvs: docweb /templates/all/www users.tpl.php

[email protected] ("Vincent Gevers")
Newsgroups php.doc.web
Message-ID <cvsvincent1122843170@cvsserver>
vincent		Sun Jul 31 16:52:50 2005 EDT

  Modified files:              
    /docweb/templates/all/www	users.tpl.php 
  Log:
  I may only edit myself...
  
  
http://cvs.php.net/diff.php/docweb/templates/all/www/users.tpl.php?r1=1.4&r2=1.5&ty=u
Index: docweb/templates/all/www/users.tpl.php
diff -u docweb/templates/all/www/users.tpl.php:1.4 docweb/templates/all/www/users.tpl.php:1.5
--- docweb/templates/all/www/users.tpl.php:1.4	Sun Jul 31 11:56:11 2005
+++ docweb/templates/all/www/users.tpl.php	Sun Jul 31 16:52:49 2005
@@ -2,6 +2,10 @@
 global $info, $doEdit, $pictureError;
 
 if (isset($doEdit)) {
+
+if ($GLOBALS['user'] == $GLOBALS['userid']) {
+// only edit yourself
+
 switch ($pictureError) {
     case 'succes':
         $errors = "&docweb.users.succes;";
@@ -33,6 +37,7 @@
     <input type="text" name="name" value="$info[name]" /></td></tr>
 <tr><td>&docweb.users.country;</td><td>
 <select name="country">
+<option value="">Please Select</option>
 $countries
 </select></td></tr>
 <tr><td>&docweb.users.website;</td><td>
@@ -46,7 +51,13 @@
 HTML;
 
 } else {
+echo '<h3>&docweb.users.error.notyou;</h3>';
+}
+
+} else {
+if (isset($info['country'])) {
 $cntrycode = $GLOBALS['COUNTRIES'][$info['country']];
+}
 echo <<< HTML
 <p><strong>&docweb.users.username;</strong>: $info[username]<br />
 <strong>&docweb.users.name;</strong>: $info[name]<br />
@@ -62,7 +73,7 @@
 
 echo '</p>';
 
-if ($info['username'] == $GLOBALS['userid']) {
+if ($GLOBALS['user'] == $GLOBALS['userid']) {
     echo '<p><a href="'.$info['username'].'/edit">Edit Your profile</a>';
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.