Source code taken from cacert-20111227.tar.bz2
authorMichael Tänzer <neo@nhng.de>
Tue, 27 Dec 2011 11:56:35 +0000 (12:56 +0100)
committerMichael Tänzer <neo@nhng.de>
Tue, 27 Dec 2011 11:56:35 +0000 (12:56 +0100)
pages/account/24.php
pages/account/27.php
pages/account/32.php
pages/account/33.php

index 19faa9f..7f56023 100644 (file)
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */ ?>
+<?
+       // Reset session variables regarding Org's, present empty form  
+       if (array_key_exists('O',$_SESSION['_config']))         $_SESSION['_config']['O'] = "";
+  if (array_key_exists('contact',$_SESSION['_config']))   $_SESSION['_config']['contact'] = "";        
+  if (array_key_exists('L',$_SESSION['_config']))         $_SESSION['_config']['L'] = "";
+  if (array_key_exists('ST',$_SESSION['_config']))        $_SESSION['_config']['ST'] = "";
+  if (array_key_exists('C',$_SESSION['_config']))         $_SESSION['_config']['C'] = "";
+  if (array_key_exists('comments',$_SESSION['_config']))  $_SESSION['_config']['comments'] = "";
+       
+?>
 <form method="post" action="account.php">
 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
   <tr>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Organisation Name")?>:</td>
-    <td class="DataTD"><input type="text" name="O" value="<?=array_key_exists('O',$_SESSION['_config'])?$_SESSION['_config']['O']:""?>" maxlength="50"></td>
+    <td class="DataTD"><input type="text" name="O" value="" maxlength="50" size="90"></td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Contact Email")?>:</td>
-    <td class="DataTD"><input type="text" name="contact" value="<?=array_key_exists('contact',$_SESSION['_config'])?$_SESSION['_config']['contact']:""?>"></td>
+    <td class="DataTD"><input type="text" name="contact" value="" size="90"></td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Town/Suburb")?>:</td>
-    <td class="DataTD"><input type="text" name="L" value="<?=array_key_exists('L',$_SESSION['_config'])?$_SESSION['_config']['L']:""?>"></td>
+    <td class="DataTD"><input type="text" name="L" value="" size="90"></td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("State/Province")?>:</td>
-    <td class="DataTD"><input type="text" name="ST" value="<?=array_key_exists('ST',$_SESSION['_config'])?$_SESSION['_config']['ST']:""?>"></td>
+    <td class="DataTD"><input type="text" name="ST" value="" size="90"></td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Country")?>:</td>
-    <td class="DataTD"><input type="text" name="C" value="<?=array_key_exists('C',$_SESSION['_config'])?sanitizeHTML($_SESSION['_config']['C']):""?>" size="5">(2 letter <a href="http://www.iso.org/iso/english_country_names_and_code_elements">ISO code</a>)</td>
+    <td class="DataTD"><input type="text" name="C" value="" size="5">(2 letter <a href="http://www.iso.org/iso/english_country_names_and_code_elements">ISO code</a>)</td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Comments")?>:</td>
-    <td class="DataTD"><textarea name="comments" cols="35" rows="5"><?=array_key_exists('comments',$_SESSION['_config'])?$_SESSION['_config']['comments']:""?></textarea></td>
+    <td class="DataTD"><textarea name="comments" cols="60" rows="10"></textarea></td>
   </tr>
   <tr>
     <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Next")?>"></td>
index 2cd52a8..9524620 100644 (file)
   </tr>
   <tr>
     <td class="DataTD"><?=_("Organisation Name")?>:</td>
-    <td class="DataTD"><input type="text" name="O" value="<?=$row['O']?>"></td>
+    <td class="DataTD"><input type="text" name="O" value="<?=$row['O']?>" size="90"></td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Contact Email")?>:</td>
-    <td class="DataTD"><input type="text" name="contact" value="<?=($row['contact'])?>"></td>
+    <td class="DataTD"><input type="text" name="contact" value="<?=($row['contact'])?>" size="90"></td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Town/Suburb")?>:</td>
-    <td class="DataTD"><input type="text" name="L" value="<?=($row['L'])?>"></td>
+    <td class="DataTD"><input type="text" name="L" value="<?=($row['L'])?>" size="90"></td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("State/Province")?>:</td>
-    <td class="DataTD"><input type="text" name="ST" value="<?=($row['ST'])?>"></td>
+    <td class="DataTD"><input type="text" name="ST" value="<?=($row['ST'])?>" size="90"></td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Country")?>:</td>
-    <td class="DataTD"><input type="text" name="C" value="<?=($row['C'])?>"></td>
+    <td class="DataTD"><input type="text" name="C" value="<?=($row['C'])?>" size="5"> (2 letter <a href="http://www.iso.org/iso/english_country_names_and_code_elements">ISO code</a>)</td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Comments")?>:</td>
-    <td class="DataTD"><textarea name="comments" cols=15 rows=5><?=($row['comments'])?></textarea></td>
+    <td class="DataTD"><textarea name="comments" cols=60 rows=10><?=($row['comments'])?></textarea></td>
   </tr>
   <tr>
     <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Update")?>"></td>
index 00dc1ea..a05c927 100644 (file)
                $user = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['memid'])."'"));
 ?>
   <tr>
-    <td class="DataTD"><a href='mailto:<?=$user['email']?>'><?=($user['fname'])?> <?=($user['lname'])?></a></td>
+    <td class="DataTD"><a href='mailto:<?=sanitizeHTML($user['email'])?>'><?=sanitizeHTML($user['fname'])?> <?=sanitizeHTML($user['lname'])?></a></td>
     <td class="DataTD"><?=($row['masteracc'])?></a></td>
-    <td class="DataTD"><?=($row['OU'])?></a></td>
-    <td class="DataTD"><?=($row['comments'])?></a></td>
+    <td class="DataTD"><?=sanitizeHTML($row['OU'])?></a></td>
+    <td class="DataTD"><?=sanitizeHTML($row['comments'])?></a></td>
 <? if($row['masteracc'] == 0 || $_SESSION['profile']['orgadmin'] == 1) { ?>
     <td class="DataTD"><a href="account.php?id=34&amp;orgid=<?=$row['orgid']?>&amp;memid=<?=$row['memid']?>"><?=_("Delete")?></a></td>
 <? } else { ?>
index 4da8bed..376a8b9 100644 (file)
 <?
        $query = "select * from `orginfo` where `id`='".intval($_REQUEST['orgid'])."'";
        $row = mysql_fetch_assoc(mysql_query($query));
+       
+       // Reset session variables regarding OrgAdmin's, present empty form
+  if (array_key_exists('email',$_SESSION['_config']))     $_SESSION['_config']['email']=""; 
+  if (array_key_exists('OU',$_SESSION['_config']))        $_SESSION['_config']['OU'] = "";
+  if (array_key_exists('masteracc',$_SESSION['_config'])) $_SESSION['_config']['masteracc'] = 0;
+  if (array_key_exists('comments',$_SESSION['_config']))  $_SESSION['_config']['comments'] = "";       
+       
 ?>
 <form method="post" action="account.php">
 <input type="hidden" name="orgid" value="<?=intval($_REQUEST['orgid'])?>">
   </tr>
   <tr>
     <td class="DataTD"><?=_("Email")?>:</td>
-    <td class="DataTD"><input type="text" name="email" value="<?=array_key_exists('email',$_SESSION['_config'])?sanitizeHTML($_SESSION['_config']['email']):""?>"></td>
+    <td class="DataTD"><input type="text" name="email" value=""></td>
   </tr>
   <tr>
     <td class="DataTD"><?=_("Department")?>:</td>
-    <td class="DataTD"><input type="text" name="OU" value="<?=array_key_exists('OU',$_SESSION['_config'])?$_SESSION['_config']['OU']:""?>"></td>
+    <td class="DataTD"><input type="text" name="OU" value=""></td>
   </tr>
 <? if($_SESSION['profile']['orgadmin'] == 1) { ?>
   <tr>
     <td class="DataTD"><?=_("Master Account")?>:</td>
     <td class="DataTD"><select name="masteracc">
-               <option value="0">No</option>
-               <option value="1"<? if(array_key_exists('masteracc',$_SESSION['_config']) && $_SESSION['_config']['masteracc'] == 1) echo " selected='selected'"; ?>>Yes</option>
+               <option value="0">No</option>     // make default option as of SA telco 2011-08-02 on bug 966
+               <option value="1">Yes</option>
        </select></td>
   </tr>
 <? } ?>
   <tr>
     <td class="DataTD"><?=_("Comments")?>:</td>
-    <td class="DataTD"><input type="text" name="comments" value="<?=array_key_exists('comments',$_SESSION['_config'])?$_SESSION['_config']['comments']:""?>"></td>
+    <td class="DataTD"><input type="text" name="comments" size=27 maxlength=20 value=""></td>
   </tr>
   <tr>
     <td class="DataTD" colspan="2"><input type="submit" name="process" value="<?=_("Add")?>"></td>