commit e12627c2e94cbfc66bb58aae75110f32953f27dc
parent ad222347cce6ba36d082a2303a3bcd5808b4fcef
Author: dankert <devnull@localhost>
Date: Sun, 2 May 2004 20:57:45 +0200
Umstellung auf Actions
Diffstat:
6 files changed, 175 insertions(+), 45 deletions(-)
diff --git a/themes/default/pages/html/user/edit.tpl.php b/themes/default/pages/html/user/edit.tpl.php
@@ -4,9 +4,8 @@
<center>
-<form action="<?php echo $action ?>" method="post" target="_self">
-<input type="hidden" name="<?php echo session_name() ?>" value="<?php echo session_id() ?>">
-<input type="hidden" name="useraction" value="save">
+<form action="<?php echo $self ?>" method="post" target="_self">
+<input type="hidden" name="subaction" value="save" />
<table class="main" width="90%" cellspacing="0" cellpadding="4">
@@ -15,40 +14,71 @@
</tr>
<tr>
-<td width="50%" class="f1"><?php echo lang('username') ?></a></td>
-<td width="50%" class="f1"><input type="text" name="name" value="<?php echo $name ?>"></td>
+<td width="50%" class="f1" rowspan="2"><?php echo lang('user_username') ?></a></td>
+<td width="50%" class="f1"><input type="text" class="name" size="20" name="name" value="<?php echo $name ?>"></td>
</tr>
+ <tr>
+ <td class="help"><?php echo lang('USER_USERNAME_DESC') ?></td>
+ </tr>
<tr>
-<td width="50%" class="f1"><?php echo lang('name') ?></a></td>
-<td width="50%" class="f1"><input type="text" name="fullname" value="<?php echo $fullname ?>"></td>
+<td width="50%" class="f1"><?php echo lang('user_fullname') ?></a></td>
+<td width="50%" class="f1"><input type="text" name="fullname" size="50" value="<?php echo $fullname ?>"></td>
</tr>
<tr>
-<td width="50%" class="f1"><?php echo lang('mail') ?></a></td>
-<td width="50%" class="f1"><input type="text" name="mail" value="<?php echo $mail ?>"></td>
+<td width="50%" class="f1"><?php echo lang('user_mail') ?></a></td>
+<td width="50%" class="f1"><input type="text" name="mail" size="50" value="<?php echo $mail ?>"><?php if ($mail!='' && !eregi('^[a-zA-Z0-9_.-]+\@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$',$mail)) echo '<strong>'.lang('USER_MAIL_INVALID').'</strong>' ?></td>
</tr>
<tr>
-<td width="50%" class="f1"><?php echo lang('ldap') ?></a></td>
-<td width="50%" class="f1"><input type="text" name="ldap" value="<?php echo $ldap ?>"></td>
+<td width="50%" class="f1"><?php echo lang('user_desc') ?></a></td>
+<td width="50%" class="f1"><input type="text" name="desc" size="50" value="<?php echo $desc ?>"></td>
</tr>
<tr>
-<td width="50%" class="f1"><?php echo lang('language') ?></a></td>
-<td width="50%" class="f1"><?php html_form_select('lang','',$alllanguages,$lang) ?></td>
+<td width="50%" class="f1"><?php echo lang('user_tel') ?></a></td>
+<td width="50%" class="f1"><input type="text" name="tel" size="50" value="<?php echo $tel ?>"></td>
</tr>
<tr>
-<td width="50%" class="f1"><?php echo lang('style') ?></a></td>
-<td width="50%" class="f1"><?php html_form_select('style','',$allstyles,$style) ?></td>
+<td width="50%" class="f1" rowspan="2"><?php echo lang('user_ldapdn') ?></a></td>
+<td width="50%" class="f1"><input type="text" name="ldap_dn" size="50" value="<?php echo $ldap_dn ?>"></td>
</tr>
+ <tr>
+ <td class="help"><?php echo lang('USER_LDAPDN_DESC') ?></td>
+ </tr>
<tr>
-<td width="50%" class="f1"><?php echo lang('admin') ?></a></td>
-<td width="50%" class="f1"><input type="checkbox" name="is_admin" value="1"<?php if ($is_admin==1) echo ' checked="checked"' ?>></td>
+<td width="50%" class="f1" rowspan="2"><?php echo lang('style') ?></a></td>
+<td width="50%" class="f1"><?php echo Html::selectBox('style',$allstyles,$style) ?></td>
</tr>
+ <tr>
+ <td class="help"><?php echo lang('USER_STYLE_DESC') ?></td>
+ </tr>
<tr>
-<td class="act" colspan="2"><input type="submit" value="<?php echo lang('SAVE') ?>"></td>
+<td width="50%" class="f1" rowspan="2"><?php echo lang('admin') ?></a></td>
+<td width="50%" class="f1"><input type="checkbox" name="is_admin" value="1"<?php if ($is_admin==1) echo ' checked="checked"' ?>></td>
</tr>
+ <tr>
+ <td class="help"><?php echo lang('USER_ISADMIN_DESC') ?></td>
+ </tr>
+
+ <tr>
+ <td class="f1" rowspan="2"><?php echo lang('DELETE') ?></a></td>
+ <td class="f1"><input type="checkbox" name="delete" value="1"></td>
+ </tr>
+ <tr>
+ <td class="help"><?php echo lang('USER_DELETE_DESC') ?></td>
+ </tr>
+
+ <tr>
+ <td class="act"><input type="submit" class="submit" value="<?php echo lang('SAVE') ?>"></td>
+ <td class="act"><input type="reset" class="reset" value="<?php echo lang('UNDO') ?>" onClick="document.forms[0].name.focus();"></td>
+ </tr>
</table>
</form>
</center>
+
+<script name="JavaScript"><!--
+document.forms[0].name.focus();
+//--></script>
+
<?php include( $tpl_dir.'footer.tpl.php') ?>
\ No newline at end of file
diff --git a/themes/default/pages/html/user/groups.tpl.php b/themes/default/pages/html/user/groups.tpl.php
@@ -2,11 +2,14 @@
<!-- $Id$ -->
-<br><br><br>
<center>
+<form action="<?php echo $self ?>" method="post" target="_self">
+<input type="hidden" name="action" value="user">
+<input type="hidden" name="subaction" value="addgroup">
+
+<table class="main" width="60%" cellspacing="0" cellpadding="4">
-<table width="80%">
<tr>
<th colspan="2"><?php echo lang('MEMBERSHIPS') ?></th>
</tr>
@@ -14,29 +17,30 @@
foreach( $memberships as $id=>$name )
{ ?>
<tr>
-<td width="50%" class="<?php if($f1==true) {echo'f1'; }else{echo'f2'; }?>"><?php echo $name ?></td>
-<td width="50%" class="<?php if($f1==true) {echo'f1';$f1=false;}else{echo'f2';$f1=true;}?>"><a href="<?php echo sid($action.'?useraction=delgroup&usergroupid='.$id) ?>"><?php echo lang('DELETE') ?></a></td>
+<td width="70%" class="<?php if($f1==true) {echo'f1'; }else{echo'f2'; }?>"><img src="<?php echo $image_dir.'icon_group.png' ?>" align="left"><?php echo $name ?></td>
+<td width="30%" class="<?php if($f1==true) {echo'f1';$f1=false;}else{echo'f2';$f1=true;}?>"><a href="<?php echo Html::url(array('action'=>'user','subaction'=>'delgroup','groupid'=>$id)) ?>"><?php echo lang('DELETE') ?></a></td>
+</tr>
+<?php }
+ if ( count($memberships) == 0 )
+ {
+?>
+<tr>
+<td colspan="2" class="f1"><?php echo lang('NOT_FOUND') ?></td>
</tr>
<?php } ?>
-</table>
-<br>
-<form action="<?php echo $action ?>" method="post" target="_self">
-<input type="hidden" name="<?php echo session_name() ?>" value="<?php echo session_id() ?>">
-<input type="hidden" name="useraction" value="addgroup">
+<?php if ( count($groups) > 0 )
+ { ?>
-<table width="80%">
<tr>
- <th colspan="2"><?php echo lang('ADD') ?></th>
-</tr>
-<tr>
- <td width="50%" class="f1"><?php html_form_select('groupid','',$groups,'') ?></a></td>
- <td width="50%" class="f1"><input type="submit" value="<?php echo lang('ADD') ?>"></td>
+ <td width="70%" class="act"><?php echo Html::selectBox('groupid',$groups) ?></a></td>
+ <td width="30%" class="act"><input type="submit" class="submit" value="<?php echo lang('ADD') ?>"></td>
</tr>
</table>
</form>
+<?php } ?>
</center>
<?php include( $tpl_dir.'footer.tpl.php') ?>
\ No newline at end of file
diff --git a/themes/default/pages/html/user/list.tpl.php b/themes/default/pages/html/user/list.tpl.php
@@ -4,22 +4,20 @@
<center>
-<form action="<?php echo $action ?>" method="post" target="_self">
-<input type="hidden" name="<?php echo session_name() ?>" value="<?php echo session_id() ?>">
+<form action="<?php echo $self ?>" method="post" target="_self">
<input type="hidden" name="useraction" value="add">
-<table class="main" width="90%" cellspacing="0" cellpadding="4">
+<table class="main" width="50%" cellspacing="0" cellpadding="4">
<tr>
- <th colspan="2"><?php echo lang('USERS') ?></th>
+ <th><?php echo lang('USERS') ?></th>
</tr>
<?php $f1=true;
foreach( $el as $id=>$e )
{ ?>
<tr>
-<td width="50%" class="<?php if($f1==true) {echo'f1'; } else{echo'f2'; }?>"><a href="<?php echo sid($e['url']) ?>"><?php echo $e['name'] ?></a></td>
-<td width="50%" class="<?php if($f1==true) {echo'f1';$f1=false;} else{echo'f2';$f1=true;}?>"><?php echo $e['type'] ?></td>
+<td class="<?php if($f1==true) {echo'f1'; } else{echo'f2'; }?>"><a href="<?php echo $e['url'] ?>" target="cms_main"><img src="<?php echo $image_dir ?>icon_user.png" border="0" align="left"><?php echo $e['name'] ?></a></td>
</tr>
<?php } ?>
@@ -32,4 +30,11 @@
</form>
</center>
+
+<script name="JavaScript">
+<!--
+window.document.forms[0].name.focus();
+//-->
+</script>
+
<?php include( $tpl_dir.'footer.tpl.php') ?>
\ No newline at end of file
diff --git a/themes/default/pages/html/user/profile.tpl.php b/themes/default/pages/html/user/profile.tpl.php
@@ -0,0 +1,81 @@
+<?php include( $tpl_dir.'header.tpl.php') ?>
+
+<!-- $Id$ -->
+
+<center>
+
+<form action="<?php echo $self ?>" method="post" target="_self">
+<input type="hidden" name="subaction" value="saveprofile">
+
+<?php $table_title = lang('user'); include( $tpl_dir.'table_open.tpl.php') ?>
+
+<tr>
+<td width="50%" class="f1"><?php echo lang('user_username') ?></a></td>
+<td width="50%" class="f1"><strong><?php echo $name ?></strong></td>
+</tr>
+
+<?php foreach( array('fullname','tel','mail','desc') as $z)
+ {
+ if ( isset($$z) )
+ { ?>
+<tr>
+<td width="50%" class="f1"><?php echo lang('USER_'.$z) ?></a></td>
+<td width="50%" class="f1"><input type="text" name="<?php echo $z ?>" size="40" maxlength="128" value="<?php echo $$z ?>"></td>
+</tr>
+<?php }
+ } ?>
+
+<?php if ( count($allstyles) > 1 )
+ { ?>
+<tr>
+<td width="50%" class="f1"><?php echo lang('style') ?></a></td>
+<td width="50%" class="f1"><?php echo Html::selectBox('style',$allstyles,$style) ?></td>
+</tr>
+ <tr>
+ <td class="act" colspan="2"><input type="submit" class="submit" value="<?php echo lang('SAVE') ?>"></td>
+ </tr>
+<?php } ?>
+
+<?php if (!isset($use_ldap))
+ { ?>
+
+<?php include( $tpl_dir.'table_close.tpl.php'); ?>
+
+</form>
+
+<form action="<?php echo $self ?>" method="post" target="_self">
+<input type="hidden" name="<?php echo session_name() ?>" value="<?php echo session_id() ?>">
+<input type="hidden" name="useraction" value="pwchange">
+
+
+<?php $table_title = lang('password');
+ include( $tpl_dir.'table_open.tpl.php'); ?>
+
+<tr>
+<td width="50%" class="f2"><?php echo lang('act_password') ?></a></td>
+<td width="50%" class="f2"><input type="password" name="act_password"></td>
+</tr>
+<tr>
+<td width="50%" class="f1"><?php echo lang('new_password') ?></a></td>
+<td width="50%" class="f1"><input type="password" name="password1"></td>
+</tr>
+<tr>
+<td width="50%" class="f2"><?php echo lang('new_password_repeat') ?></a></td>
+<td width="50%" class="f2"><input type="password" name="password2"></td>
+</tr>
+<?php } ?>
+ <tr>
+ <td class="act" colspan="2"><input type="submit" class="submit" value="<?php echo lang('SAVE') ?>"></td>
+ </tr>
+
+<?php include( $tpl_dir.'table_close.tpl.php') ?>
+
+</form>
+
+</center>
+
+<script name="JavaScript"><!--
+document.forms[0].fullname.focus();
+//--></script>
+
+<?php include( $tpl_dir.'footer.tpl.php') ?>+
\ No newline at end of file
diff --git a/themes/default/pages/html/user/pw.tpl.php b/themes/default/pages/html/user/pw.tpl.php
@@ -4,7 +4,7 @@
<center>
-<form action="<?php echo $action ?>" method="post" target="_self">
+<form action="<?php echo $self ?>" method="post" target="_self">
<input type="hidden" name="<?php echo session_name() ?>" value="<?php echo session_id() ?>">
<input type="hidden" name="useraction" value="pwchange">
@@ -13,14 +13,18 @@
<th colspan="2"><?php echo lang('PASSWORD') ?></th>
</tr>
<tr>
-<td width="50%" class="f1"><?php echo lang('password') ?></a></td>
+<td width="50%" class="f1"><?php echo lang('new_password') ?></a></td>
<td width="50%" class="f1"><input type="password" name="password1"></td>
</tr>
<tr>
-<td width="50%" class="f2"><?php echo lang('passwordrepeat') ?></a></td>
+<td width="50%" class="f2"><?php echo lang('new_password_repeat') ?></a></td>
<td width="50%" class="f2"><input type="password" name="password2"></td>
</tr>
<tr>
+<td width="50%" class="f2"><?php echo lang('user_mail_new_password') ?></a></td>
+<td width="50%" class="f2"><?php echo Html::checkBox('mail',false,true) ?></td>
+</tr>
+<tr>
<td class="act" colspan="2"><input type="submit" class="submit" value="<?php echo lang('SAVE') ?>"></td>
</tr>
</table>
@@ -28,4 +32,9 @@
</form>
</center>
+
+<script name="JavaScript"><!--
+document.forms[0].password1.focus();
+//--></script>
+
<?php include( $tpl_dir.'footer.tpl.php') ?>
\ No newline at end of file
diff --git a/themes/default/pages/html/user/show.tpl.php b/themes/default/pages/html/user/show.tpl.php
@@ -12,7 +12,7 @@
<table width="80%">
<tr>
- <th colspan="2"><?php echo lang('USER') ?> <a href="<?php echo sid($action.'?useraction=edit') ?>"><?php echo lang('EDIT') ?></a></th>
+ <th colspan="2"><?php echo lang('USER') ?> <a href="<?php echo Html::url(array('action'=>'user','subaction'=>'edit')) ?>"><?php echo lang('EDIT') ?></a></th>
</tr>
<tr>
@@ -51,7 +51,7 @@
<table width="80%">
<tr>
- <th colspan="2"><?php echo lang('MEMBERSHIPS') ?><a href="<?php echo sid($action.'?useraction=groups') ?>"><?php echo lang('EDIT') ?></a></th>
+ <th colspan="2"><?php echo lang('MEMBERSHIPS') ?><a href="<?php echo $action.'?useraction=groups' ?>"><?php echo lang('EDIT') ?></a></th>
</tr>
<?php $f1=true;
foreach( $memberships as $id=>$name )
@@ -74,7 +74,7 @@
{ ?>
<tr>
<td width="50%" class="<?php if($f1==true) {echo'f1'; }else{echo'f2'; }?>"><?php echo $name ?></td>
-<td width="50%" class="<?php if($f1==true) {echo'f1';$f1=false;}else{echo'f2';$f1=true;}?>"><a href="<?php echo sid($action.'?useraction=delacl&aclid='.$id) ?>"><?php echo lang('DELETE') ?></a></td>
+<td width="50%" class="<?php if($f1==true) {echo'f1';$f1=false;}else{echo'f2';$f1=true;}?>"><a href="<?php echo Html::url(array('action'=>'user','subaction'=>'delacl','aclid'=>$id)) ?>"><?php echo lang('DELETE') ?></a></td>
</tr>
<?php } ?>
</table>