From: <jon...@us...> - 2009-12-03 11:28:58
|
Revision: 23643 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=23643&view=rev Author: jonnybradley Date: 2009-12-03 10:28:35 +0000 (Thu, 03 Dec 2009) Log Message: ----------- [FIX] More WYSIWYCA approach to user admin Modified Paths: -------------- branches/4.x/templates/tiki-adminusers.tpl Modified: branches/4.x/templates/tiki-adminusers.tpl =================================================================== --- branches/4.x/templates/tiki-adminusers.tpl 2009-12-03 02:34:53 UTC (rev 23642) +++ branches/4.x/templates/tiki-adminusers.tpl 2009-12-03 10:28:35 UTC (rev 23643) @@ -129,93 +129,89 @@ </tr> {cycle print=false values="even,odd"} {section name=user loop=$users} - {capture assign=username}{$users[user].user|escape}{/capture} - <tr class="{cycle}"> - <td class="thin"> - {if $users[user].user ne 'admin'} - <input type="checkbox" name="checked[]" value="{$users[user].user|escape}" {if $users[user].checked eq 'y'}checked="checked" {/if}/> - {/if} - </td> - - <td> - {if $users[user].editable} + {if $users[user].editable} + {capture assign=username}{$users[user].user|escape}{/capture} + <tr class="{cycle}"> + <td class="thin"> + {if $users[user].user ne 'admin'} + <input type="checkbox" name="checked[]" value="{$users[user].user|escape}" {if $users[user].checked eq 'y'}checked="checked" {/if}/> + {/if} + </td> + + <td> <a class="link" href="tiki-adminusers.php?offset={$offset}&numrows={$numrows}&sort_mode={$sort_mode}&user={$users[user].userId}{if $prefs.feature_tabs ne 'y'}#2{/if}" title="{tr}Edit Account Settings:{/tr} {$users[user].user|username}">{$users[user].user|username}</a> - {else} - {$users[user].user|username} + </td> + + {if $prefs.login_is_email ne 'y'} + <td>{$users[user].email}</td> {/if} - </td> - - {if $prefs.login_is_email ne 'y'} - <td>{$users[user].email}</td> - {/if} - - <td> - {if $users[user].currentLogin eq ''} - {tr}Never{/tr} <em>({tr}Registered{/tr} {$users[user].age|duration_short} {tr}ago{/tr})</em> - {else} - {$users[user].currentLogin|dbg|tiki_long_datetime} - {/if} - - {if $users[user].waiting eq 'u'} - <br /> - {tr}Need to validate email{/tr} - {/if} - </td> - - <td class="thin"> - <a class="link" href="tiki-assignuser.php?assign_user={$users[user].user|escape:url}" title="{tr}Assign to group{/tr}">{icon _id='group_key' alt="{tr}Assign{/tr} `$username` {tr}to groups{/tr} "}</a> - </td> - - <td> - {foreach from=$users[user].groups key=grs item=what name=gr} - <div style="white-space:nowrap"> - {if $grs != "Anonymous" and ($tiki_p_admin eq 'y' || in_array($grs, $all_groups))} - {if $what ne 'included' and $grs != "Registered"} - {self_link _class='link' user=$users[user].user action='removegroup' group=$grs _icon='cross' _title="{tr}Remove{/tr} `$username` {tr}from{/tr} $grs"}{/self_link} - {else} - {icon _id='bullet_white'} + + <td> + {if $users[user].currentLogin eq ''} + {tr}Never{/tr} <em>({tr}Registered{/tr} {$users[user].age|duration_short} {tr}ago{/tr})</em> + {else} + {$users[user].currentLogin|dbg|tiki_long_datetime} + {/if} + + {if $users[user].waiting eq 'u'} + <br /> + {tr}Need to validate email{/tr} + {/if} + </td> + + <td class="thin"> + <a class="link" href="tiki-assignuser.php?assign_user={$users[user].user|escape:url}" title="{tr}Assign to group{/tr}">{icon _id='group_key' alt="{tr}Assign{/tr} `$username` {tr}to groups{/tr} "}</a> + </td> + + <td> + {foreach from=$users[user].groups key=grs item=what name=gr} + <div style="white-space:nowrap"> + {if $grs != "Anonymous" and ($tiki_p_admin eq 'y' || in_array($grs, $all_groups))} + {if $what ne 'included' and $grs != "Registered"} + {self_link _class='link' user=$users[user].user action='removegroup' group=$grs _icon='cross' _title="{tr}Remove{/tr} `$username` {tr}from{/tr} $grs"}{/self_link} + {else} + {icon _id='bullet_white'} + {/if} + {if $what eq 'included'}<i>{/if} + {if $tiki_p_admin eq 'y'} + <a class="link" {$link_style} href="tiki-admingroups.php?group={$grs|escape:"url"}" title={if $what eq 'included'}"{tr}Edit Included Group{/tr}"{else}"{tr}Edit Group:{/tr} {$grs|escape}"{/if}> + {/if} + {$grs|escape} + {if $tiki_p_admin eq 'y'} + </a> + {/if} + {if $what eq 'included'}</i>{/if} + {if $grs eq $users[user].default_group}<small>({tr}default{/tr})</small>{/if} + {if !$smarty.foreach.gr.last}<br />{/if} {/if} - {if $what eq 'included'}<i>{/if} - {if $tiki_p_admin eq 'y'} - <a class="link" {$link_style} href="tiki-admingroups.php?group={$grs|escape:"url"}" title={if $what eq 'included'}"{tr}Edit Included Group{/tr}"{else}"{tr}Edit Group:{/tr} {$grs|escape}"{/if}> - {/if} - {$grs|escape} - {if $tiki_p_admin eq 'y'} - </a> - {/if} - {if $what eq 'included'}</i>{/if} - {if $grs eq $users[user].default_group}<small>({tr}default{/tr})</small>{/if} - {if !$smarty.foreach.gr.last}<br />{/if} - {/if} - </div> - {/foreach} - </td> - - <td> - {if $users[user].editable} + </div> + {/foreach} + </td> + + <td> {self_link _class="link" user=`$users[user].userId` _icon="page_edit" _title="{tr}Edit Account Settings:{/tr} `$username`"}{/self_link} {if $prefs.feature_userPreferences eq 'y' || $user eq 'admin'} <a class="link" href="tiki-user_preferences.php?userId={$users[user].userId}" title="{tr}Change user preferences:{/tr} {$username}">{icon _id='wrench' alt="{tr}Change user preferences:{/tr} `$username`"}</a> {/if} - {/if} - {if $users[user].editable or $users[user].user eq $user or $users[user].user_information neq 'private'} - <a class="link" href="tiki-user_information.php?userId={$users[user].userId}" title="{tr}User Information:{/tr} {$username}">{icon _id='help' alt="{tr}User Information:{/tr} `$username`"}</a> - {/if} - - {if $users[user].user ne 'admin' and $users[user].editable} - <a class="link" href="{$smarty.server.PHP_SELF}?{query action=delete user=$users[user].user}" title="{tr}Delete{/tr}">{icon _id='cross' alt='{tr}Delete{/tr}'}</a> - {if $users[user].valid && $users[user].waiting eq 'a'} - <a class="link" href="tiki-login_validate.php?user={$users[user].user|escape:url}&pass={$users[user].valid|escape:url}" title="{tr}Validate user:{/tr} {$users[user].user|username}">{icon _id='accept' alt="{tr}Validate user:{/tr} `$username`"}</a> + {if $users[user].user eq $user or $users[user].user_information neq 'private'} + <a class="link" href="tiki-user_information.php?userId={$users[user].userId}" title="{tr}User Information:{/tr} {$username}">{icon _id='help' alt="{tr}User Information:{/tr} `$username`"}</a> {/if} - {if $users[user].waiting eq 'u'} - <a class="link" href="tiki-confirm_user_email.php?user={$users[user].user|escape:url}&pass={$users[user].provpass|md5|escape:url}" title="{tr}Confirm user email:{/tr} {$users[user].user|username}">{icon _id='email_go' alt="{tr}Confirm user email:{/tr} `$username`"}</a> + + {if $users[user].user ne 'admin'} + <a class="link" href="{$smarty.server.PHP_SELF}?{query action=delete user=$users[user].user}" title="{tr}Delete{/tr}">{icon _id='cross' alt='{tr}Delete{/tr}'}</a> + {if $users[user].valid && $users[user].waiting eq 'a'} + <a class="link" href="tiki-login_validate.php?user={$users[user].user|escape:url}&pass={$users[user].valid|escape:url}" title="{tr}Validate user:{/tr} {$users[user].user|username}">{icon _id='accept' alt="{tr}Validate user:{/tr} `$username`"}</a> + {/if} + {if $users[user].waiting eq 'u'} + <a class="link" href="tiki-confirm_user_email.php?user={$users[user].user|escape:url}&pass={$users[user].provpass|md5|escape:url}" title="{tr}Confirm user email:{/tr} {$users[user].user|username}">{icon _id='email_go' alt="{tr}Confirm user email:{/tr} `$username`"}</a> + {/if} + {if $prefs.email_due > 0 and $users[user].waiting ne 'u' and $users[user].waiting ne 'a'} + <a class="link" href="tiki-adminusers.php?user={$users[user].user|escape:url}&action=email_due" title="{tr}Invalid email{/tr}">{icon _id='email_cross' alt="{tr}Invalid email{/tr}"}</a> + {/if} {/if} - {if $prefs.email_due > 0 and $users[user].waiting ne 'u' and $users[user].waiting ne 'a'} - <a class="link" href="tiki-adminusers.php?user={$users[user].user|escape:url}&action=email_due" title="{tr}Invalid email{/tr}">{icon _id='email_cross' alt="{tr}Invalid email{/tr}"}</a> - {/if} - {/if} - </td> - </tr> + </td> + </tr> + {/if} {sectionelse} <tr class="odd"> <td colspan="8">{tr}No records found.{/tr}</td> @@ -309,170 +305,172 @@ {tab name=$add_edit_user_tablabel} {if $userinfo.userId} <h2>{tr}Edit user:{/tr} {$userinfo.login|escape}</h2> - {if $userinfo.login ne 'admin'} + {if $userinfo.login ne 'admin' and $userinfo.editable} {assign var=thisloginescaped value=$userinfo.login|escape:'url'} {button href="tiki-assignuser.php?assign_user=$thisloginescaped" _text="{tr}Assign user to Groups{/tr}"} {/if} {else} <h2>{tr}Add a New User{/tr}</h2> {/if} - <form action="tiki-adminusers.php" method="post" enctype="multipart/form-data" name="RegForm" autocomplete="off"> - <table class="normal"> - <tr class="formcolor"> - <td><label for="name"> - {if $prefs.login_is_email eq 'y'} - {tr}Email:{/tr} - {else} - {tr}User:{/tr} - {/if} - </label> - </td> - <td> - {if $userinfo.login neq 'admin' and $userinfo.editable} - <input type="text" id="name" name="name" value="{$userinfo.login|escape}" /> - <br /> + {if $userinfo.editable} + <form action="tiki-adminusers.php" method="post" enctype="multipart/form-data" name="RegForm" autocomplete="off"> + <table class="normal"> + <tr class="formcolor"> + <td><label for="name"> {if $prefs.login_is_email eq 'y'} - <em>{tr}Use the email as username{/tr}.</em> - {elseif $prefs.lowercase_username eq 'y'} - <em>{tr}Lowercase only{/tr}</em>. + {tr}Email:{/tr} + {else} + {tr}User:{/tr} {/if} - <br /> - {if $userinfo.userId} - <p> - {icon _id=exclamation alt="{tr}Warning{/tr}" style="vertical-align:middle"} - <em>{tr}Warning: changing the username could require the user to change his password (for user registered with an old tikiwiki<=1.8){/tr}</em> - </p> - {if $prefs.feature_intertiki_server eq 'y'} - <i>{tr}Warning: it will mess with slave intertiki sites that use this one as master{/tr}</i> - {/if} - {/if} - {else} - <input type="hidden" name="name" value="{$userinfo.login|escape}" />{$userinfo.login} - {/if} - </td> - </tr> - {* - No need to specify user password or to ask him to change it, if : - --> Tiki is using the Tiki + PEAR Auth systems - --> AND Tiki won't create the user in the Tiki auth system - --> AND Tiki won't create the user in the ldap - *} - {if $prefs.auth_method eq 'ldap' and ( $prefs.ldap_create_user_tiki eq 'n' or $prefs.ldap_skip_admin eq 'y' ) and $prefs.ldap_create_user_ldap eq 'n' and $userinfo.login neq 'admin' and $auth_ldap_permit_tiki_users eq 'n'} - <tr class="formcolor"> - <td colspan="2"> - <b>{tr}No password is required{/tr}</b> - <br /> - <i>{tr}Tikiwiki is configured to delegate the password managment to LDAP.{/tr}</i> + </label> </td> - </tr> - {elseif $userinfo.editable} - <tr class="formcolor"> - <td><label for="pass1">{tr}Password:{/tr}</label></td> <td> - <input type="password" name="pass" id="pass1" onkeyup="runPassword(this.value, 'mypassword');" /> - <div style="float:right;width:150px;margin-left:5px;"> - <div id="mypassword_text"></div> - <div id="mypassword_bar" style="font-size: 5px; height: 2px; width: 0px;"></div> - </div> - <br /> - {if $prefs.min_pass_length > 1} - <em>{tr}Minimum {$prefs.min_pass_length} characters long{/tr}</em>. + {if $userinfo.login neq 'admin'} + <input type="text" id="name" name="name" value="{$userinfo.login|escape}" /> + <br /> + {if $prefs.login_is_email eq 'y'} + <em>{tr}Use the email as username{/tr}.</em> + {elseif $prefs.lowercase_username eq 'y'} + <em>{tr}Lowercase only{/tr}</em>. + {/if} + <br /> + {if $userinfo.userId} + <p> + {icon _id=exclamation alt="{tr}Warning{/tr}" style="vertical-align:middle"} + <em>{tr}Warning: changing the username could require the user to change his password (for user registered with an old tikiwiki<=1.8){/tr}</em> + </p> + {if $prefs.feature_intertiki_server eq 'y'} + <i>{tr}Warning: it will mess with slave intertiki sites that use this one as master{/tr}</i> + {/if} + {/if} + {else} + <input type="hidden" name="name" value="{$userinfo.login|escape}" />{$userinfo.login} {/if} - {if $prefs.pass_chr_num eq 'y'} - <em>{tr}Password must contain both letters and numbers{/tr}</em>. - {/if} - {if ! ( $prefs.auth_method eq 'ldap' and ( $prefs.ldap_create_user_tiki eq 'n' or $prefs.ldap_skip_admin eq 'y' ) and $prefs.ldap_create_user_ldap eq 'n' ) } - <p> - <div> - {button href="#" _onclick="genPass('genepass','pass1','pass2');runPassword(document.RegForm.genpass.value, 'mypassword');return false;" _text="{tr}Generate a password{/tr}"} - <input id='genepass' name="genpass" type="text" /> - </div> - </p> - {/if} </td> </tr> - <tr class="formcolor"> - <td><label for="pass2">{tr}Repeat Password:{/tr}</label></td> - <td><input type="password" name="pass2" id="pass2" /></td> - </tr> - {if $userinfo.login neq 'admin' and empty($userinfo.userId)} + {* + No need to specify user password or to ask him to change it, if : + --> Tiki is using the Tiki + PEAR Auth systems + --> AND Tiki won't create the user in the Tiki auth system + --> AND Tiki won't create the user in the ldap + *} + {if $prefs.auth_method eq 'ldap' and ( $prefs.ldap_create_user_tiki eq 'n' or $prefs.ldap_skip_admin eq 'y' ) and $prefs.ldap_create_user_ldap eq 'n' and $userinfo.login neq 'admin' and $auth_ldap_permit_tiki_users eq 'n'} <tr class="formcolor"> + <td colspan="2"> + <b>{tr}No password is required{/tr}</b> + <br /> + <i>{tr}Tikiwiki is configured to delegate the password managment to LDAP.{/tr}</i> + </td> + </tr> + {else} + <tr class="formcolor"> + <td><label for="pass1">{tr}Password:{/tr}</label></td> + <td> + <input type="password" name="pass" id="pass1" onkeyup="runPassword(this.value, 'mypassword');" /> + <div style="float:right;width:150px;margin-left:5px;"> + <div id="mypassword_text"></div> + <div id="mypassword_bar" style="font-size: 5px; height: 2px; width: 0px;"></div> + </div> + <br /> + {if $prefs.min_pass_length > 1} + <em>{tr}Minimum {$prefs.min_pass_length} characters long{/tr}</em>. + {/if} + {if $prefs.pass_chr_num eq 'y'} + <em>{tr}Password must contain both letters and numbers{/tr}</em>. + {/if} + {if ! ( $prefs.auth_method eq 'ldap' and ( $prefs.ldap_create_user_tiki eq 'n' or $prefs.ldap_skip_admin eq 'y' ) and $prefs.ldap_create_user_ldap eq 'n' ) } + <p> + <div> + {button href="#" _onclick="genPass('genepass','pass1','pass2');runPassword(document.RegForm.genpass.value, 'mypassword');return false;" _text="{tr}Generate a password{/tr}"} + <input id='genepass' name="genpass" type="text" /> + </div> + </p> + {/if} + </td> + </tr> + <tr class="formcolor"> + <td><label for="pass2">{tr}Repeat Password:{/tr}</label></td> + <td><input type="password" name="pass2" id="pass2" /></td> + </tr> + {if $userinfo.login neq 'admin' and empty($userinfo.userId)} + <tr class="formcolor"> + <td> </td> + <td> + <label><input type="checkbox" name="pass_first_login"{if $userinfo.pass_confirm eq '0'} checked="checked"{/if} /> + {tr}User must change password at first login{/tr}.</label> + </td> + </tr> + {/if} + {/if} + + {if $prefs.login_is_email neq 'y'} + <tr class="formcolor"> + <td><label for="email">{tr}Email:{/tr}</label></td> + <td> + <input type="text" id="email" name="email" size="30" value="{$userinfo.email|escape}" /> + </td> + </tr> + {/if} + {if $userinfo.login neq 'admin' and ($prefs.validateUsers eq 'y' or $prefs.validateRegistration eq 'y')} + <tr class="formcolor"> <td> </td> <td> - <label><input type="checkbox" name="pass_first_login"{if $userinfo.pass_confirm eq '0'} checked="checked"{/if} /> - {tr}User must change password at first login{/tr}.</label> + <label><input type="checkbox" name="need_email_validation" {if ($userinfo.login eq '' and ($prefs.validateUsers eq 'y' or $prefs.validateRegistration eq 'y')) or $userinfo.provpass neq ''}checked="checked" {/if}/> + {tr}Send an email to the user in order to allow him to validate his account.{/tr}</label> + + {if empty($prefs.sender_email)}<br /><span class="highlight">{tr}You need to set <a href="tiki-admin.php?page=general">Sender Email</a>{/tr}</span>{/if} + </td> </tr> {/if} - {/if} - - {if $prefs.login_is_email neq 'y' and $userinfo.editable} - <tr class="formcolor"> - <td><label for="email">{tr}Email:{/tr}</label></td> - <td> - <input type="text" id="email" name="email" size="30" value="{$userinfo.email|escape}" /> - </td> - </tr> - {/if} - {if $userinfo.login neq 'admin' and ($prefs.validateUsers eq 'y' or $prefs.validateRegistration eq 'y') and $userinfo.editable} - <tr class="formcolor"> - <td> </td> - <td> - <label><input type="checkbox" name="need_email_validation" {if ($userinfo.login eq '' and ($prefs.validateUsers eq 'y' or $prefs.validateRegistration eq 'y')) or $userinfo.provpass neq ''}checked="checked" {/if}/> - {tr}Send an email to the user in order to allow him to validate his account.{/tr}</label> - - {if empty($prefs.sender_email)}<br /><span class="highlight">{tr}You need to set <a href="tiki-admin.php?page=general">Sender Email</a>{/tr}</span>{/if} - - </td> - </tr> - {/if} - {if $userinfo.userId != 0} - <tr class="formcolor"> - <td>{tr}Created:{/tr}</td> - <td>{$userinfo.created|tiki_long_datetime}</td> - </tr> - {if $userinfo.login neq 'admin'} + {if $userinfo.userId != 0} <tr class="formcolor"> - <td>{tr}Registered:{/tr}</td> - <td>{if $userinfo.registrationDate}{$userinfo.registrationDate|tiki_long_datetime}{/if}</td> + <td>{tr}Created:{/tr}</td> + <td>{$userinfo.created|tiki_long_datetime}</td> </tr> + {if $userinfo.login neq 'admin'} + <tr class="formcolor"> + <td>{tr}Registered:{/tr}</td> + <td>{if $userinfo.registrationDate}{$userinfo.registrationDate|tiki_long_datetime}{/if}</td> + </tr> + {/if} + <tr class="formcolor"> + <td>{tr}Last Login:{/tr}</td> + <td> + {if $userinfo.lastLogin} + {$userinfo.lastLogin|tiki_long_datetime|default:'Never'} + {/if} + </td> + </tr> {/if} <tr class="formcolor"> - <td>{tr}Last Login:{/tr}</td> + <td> </td> <td> - {if $userinfo.lastLogin} - {$userinfo.lastLogin|tiki_long_datetime|default:'Never'} - {/if} - </td> - </tr> - {/if} - <tr class="formcolor"> - <td> </td> - <td> - {if $userinfo.userId} - {if $userinfo.editable} + {if $userinfo.userId} <input type="hidden" name="user" value="{$userinfo.userId|escape}" /> <input type="hidden" name="edituser" value="1" /> <input type="submit" name="submit" value="{tr}Save{/tr}" /> + {else} + <input type="submit" name="newuser" value="{tr}Add{/tr}" /> {/if} - {else} - <input type="submit" name="newuser" value="{tr}Add{/tr}" /> - {/if} - </td> - </tr> - </table> - <br /> - <br /> - - {if $prefs.userTracker eq 'y'} - {if $userstrackerid and $usersitemid} - {tr}User tracker item : {$usersitemid}{/tr} - {button href="tiki-view_tracker_item.php?trackerId=$userstrackerid&itemId=$usersitemid&show=mod" _text="{tr}Edit Item{/tr}"} - {/if} + </td> + </tr> + </table> <br /> <br /> - {/if} - </form> + + {if $prefs.userTracker eq 'y'} + {if $userstrackerid and $usersitemid} + {tr}User tracker item : {$usersitemid}{/tr} + {button href="tiki-view_tracker_item.php?trackerId=$userstrackerid&itemId=$usersitemid&show=mod" _text="{tr}Edit Item{/tr}"} + {/if} + <br /> + <br /> + {/if} + </form> + {else} + {tr}You do not have permission to edit this user{/tr} + {/if} {/tab} {* ---------------------- tab with upload -------------------- *} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |