aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to 'admin')
-rw-r--r--admin/template/goto/user_list.tpl116
-rw-r--r--admin/user_list.php53
2 files changed, 95 insertions, 74 deletions
diff --git a/admin/template/goto/user_list.tpl b/admin/template/goto/user_list.tpl
index 49e1828ec..daf193ed9 100644
--- a/admin/template/goto/user_list.tpl
+++ b/admin/template/goto/user_list.tpl
@@ -1,3 +1,4 @@
+{* $Id: user_list.tpl 2578 2008-09-24 00:51:40Z rvelices $ *}
<div class="titrePage">
<h2>{'title_liste_users'|@translate}</h2>
</div>
@@ -5,19 +6,20 @@
<form class="filter" method="post" name="add_user" action="{$F_ADD_ACTION}">
<fieldset>
<legend>{'Add a user'|@translate}</legend>
- <label>{'Username'|@translate} <input type="text" name="login" maxlength="50" size="20"></label>
- <label>{'Password'|@translate} <input type="text" name="password"></label>
- <label>{'Email address'|@translate} <input type="text" name="email"></label>
- <label>&nbsp; <input class="submit" type="submit" name="submit_add" value="{'Submit'|@translate}" {$TAG_INPUT_ENABLED}></label>
+ <label>{'Username'|@translate} <input type="text" name="login" maxlength="50" size="20" /></label>
+ <label>{'Password'|@translate} <input type="password" name="password" /></label>
+ <label>{'Confirm Password'|@translate} <input type="password" name="password_conf" id="password_conf" /></label>
+ <label>{'Email address'|@translate} <input type="text" name="email" /></label>
+ <label>&nbsp; <input class="submit" type="submit" name="submit_add" value="{'Submit'|@translate}" {$TAG_INPUT_ENABLED} /></label>
</fieldset>
</form>
<form class="filter" method="get" name="filter" action="{$F_FILTER_ACTION}">
<fieldset>
<legend>{'Filter'|@translate}</legend>
- <input type="hidden" name="page" value="user_list">
+ <input type="hidden" name="page" value="user_list" />
- <label>{'Username'|@translate} <input type="text" name="username" value="{$F_USERNAME}"></label>
+ <label>{'Username'|@translate} <input type="text" name="username" value="{$F_USERNAME}" /></label>
<label>
{'status'|@translate}
@@ -41,7 +43,7 @@
<label>
&nbsp;
- <input class="submit" type="submit" value="{'Submit'|@translate}">
+ <input class="submit" type="submit" value="{'Submit'|@translate}" />
</label>
</fieldset>
@@ -70,7 +72,7 @@
{foreach from=$users item=user name=users_loop}
<tr class="{if $smarty.foreach.users_loop.index is odd}row1{else}row2{/if}">
- <td><input type="checkbox" name="selection[]" value="{$user.ID}" {$user.CHECKED} id="selection-{$user.ID}"></td>
+ <td><input type="checkbox" name="selection[]" value="{$user.ID}" {$user.CHECKED} id="selection-{$user.ID}" /></td>
<td><label for="selection-{$user.ID}">{$user.USERNAME}</label></td>
<td>{$user.STATUS}</td>
<td>{$user.EMAIL}</td>
@@ -80,8 +82,8 @@
<td>{$data}</td>
{/foreach}
<td style="text-align:center;">
- <a href="{$user.U_PERM}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/permissions.png" class="button" style="border:none" alt="{'permissions'|@translate}" title="{'permissions'|@translate}"></a>
- <a href="{$user.U_PROFILE}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" class="button" style="border:none" alt="{'Profile'|@translate}" title="{'Profile'|@translate}"></a>
+ <a href="{$user.U_PERM}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/permissions.png" class="button" style="border:none" alt="{'permissions'|@translate}" title="{'permissions'|@translate}" /></a>
+ <a href="{$user.U_PROFILE}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/edit_s.png" class="button" style="border:none" alt="{'Profile'|@translate}" title="{'Profile'|@translate}" /></a>
{foreach from=$user.plugin_actions item=data}
{$data}
{/foreach}
@@ -90,13 +92,13 @@
{/foreach}
</table>
-{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
+<div class="navigationBar">{$NAVBAR}</div>
{* delete the selected users ? *}
<fieldset>
<legend>{'Deletions'|@translate}</legend>
- <label><input type="checkbox" name="confirm_deletion" value="1"> {'confirm'|@translate}</label>
- <input class="submit" type="submit" value="{'Delete selected users'|@translate}" name="delete" {$TAG_INPUT_ENABLED}>
+ <label><input type="checkbox" name="confirm_deletion" value="1" /> {'confirm'|@translate}</label>
+ <input class="submit" type="submit" value="{'Delete selected users'|@translate}" name="delete" {$TAG_INPUT_ENABLED}/>
</fieldset>
<fieldset>
@@ -106,8 +108,8 @@
<tr>
<td>{'Status'|@translate}</td>
<td>
- <label><input type="radio" name="status_action" value="leave" checked="checked"> {'leave'|@translate}</label>
- <label><input type="radio" name="status_action" value="set" id="status_action_set"> {'set to'|@translate}</label>
+ <label><input type="radio" name="status_action" value="leave" checked="checked" /> {'leave'|@translate}</label>
+ <label><input type="radio" name="status_action" value="set" id="status_action_set" /> {'set to'|@translate}</label>
<select onchange="document.getElementById('status_action_set').checked = true;" name="status" size="1">
{html_options options=$pref_status_options selected=$pref_status_selected}
</select>
@@ -118,10 +120,10 @@
<tr>
<td>{'adviser'|@translate}</td>
<td>
- <label><input type="radio" name="adviser" value="leave" checked="checked"> {'leave'|@translate}</label>
+ <label><input type="radio" name="adviser" value="leave" checked="checked" /> {'leave'|@translate}</label>
/ {'set to'|@translate}
- <label><input type="radio" name="adviser" value="true">{'Yes'|@translate}</label>
- <label><input type="radio" name="adviser" value="false">{'No'|@translate}</label>
+ <label><input type="radio" name="adviser" value="true" />{'Yes'|@translate}</label>
+ <label><input type="radio" name="adviser" value="false" />{'No'|@translate}</label>
</td>
</tr>
{/if}
@@ -162,18 +164,18 @@
<tr>
<td>{'enabled_high'|@translate}</td>
<td>
- <label><input type="radio" name="enabled_high" value="leave" checked="checked"> {'leave'|@translate}</label>
+ <label><input type="radio" name="enabled_high" value="leave" checked="checked" /> {'leave'|@translate}</label>
/ {'set to'|@translate}
- <label><input type="radio" name="enabled_high" value="true">{'Yes'|@translate}</label>
- <label><input type="radio" name="enabled_high" value="false">{'No'|@translate}</label>
+ <label><input type="radio" name="enabled_high" value="true" />{'Yes'|@translate}</label>
+ <label><input type="radio" name="enabled_high" value="false" />{'No'|@translate}</label>
</td>
</tr>
<tr>
<td>{'Privacy level'|@translate}</td>
<td>
- <label><input type="radio" name="level_action" value="leave" checked="checked">{'leave'|@translate}</label>
- <label><input type="radio" name="level_action" value="set" id="level_action_set">{'set to'|@translate}</label>
+ <label><input type="radio" name="level_action" value="leave" checked="checked" />{'leave'|@translate}</label>
+ <label><input type="radio" name="level_action" value="set" id="level_action_set" />{'set to'|@translate}</label>
<select onchange="document.getElementById('level_action_set').checked = true;" name="level" size="1">
{html_options options=$level_options selected=$level_selected}
</select>
@@ -193,28 +195,28 @@
<tr>
<td>{'nb_image_per_row'|@translate}</td>
<td>
- <label><input type="radio" name="nb_image_line_action" value="leave" checked="checked"> {'leave'|@translate}</label>
- <label><input type="radio" name="nb_image_line_action" value="set" id="nb_image_line_action_set"> {'set to'|@translate}</label>
+ <label><input type="radio" name="nb_image_line_action" value="leave" checked="checked" /> {'leave'|@translate}</label>
+ <label><input type="radio" name="nb_image_line_action" value="set" id="nb_image_line_action_set" /> {'set to'|@translate}</label>
<input onmousedown="document.getElementById('nb_image_line_action_set').checked = true;"
- size="3" maxlength="2" type="text" name="nb_image_line" value="{$NB_IMAGE_LINE}">
+ size="3" maxlength="2" type="text" name="nb_image_line" value="{$NB_IMAGE_LINE}" />
</td>
</tr>
<tr>
<td>{'nb_row_per_page'|@translate}</td>
<td>
- <label><input type="radio" name="nb_line_page_action" value="leave" checked="checked"> {'leave'|@translate}</label>
- <label><input type="radio" name="nb_line_page_action" value="set" id="nb_line_page_action_set"> {'set to'|@translate}</label>
+ <label><input type="radio" name="nb_line_page_action" value="leave" checked="checked" /> {'leave'|@translate}</label>
+ <label><input type="radio" name="nb_line_page_action" value="set" id="nb_line_page_action_set" /> {'set to'|@translate}</label>
<input onmousedown="document.getElementById('nb_line_page_action_set').checked = true;"
- size="3" maxlength="2" type="text" name="nb_line_page" value="{$NB_LINE_PAGE}">
+ size="3" maxlength="2" type="text" name="nb_line_page" value="{$NB_LINE_PAGE}" />
<td>
</tr>
<tr>
<td>{'theme'|@translate}</td>
<td>
- <label><input type="radio" name="template_action" value="leave" checked="checked"> {'leave'|@translate}</label>
- <label><input type="radio" name="template_action" value="set" id="template_action_set"> {'set to'|@translate}</label>
+ <label><input type="radio" name="template_action" value="leave" checked="checked" /> {'leave'|@translate}</label>
+ <label><input type="radio" name="template_action" value="set" id="template_action_set" /> {'set to'|@translate}</label>
<select onchange="document.getElementById('template_action_set').checked = true;" name="template" size="1">
{html_options values=$template_options output=$template_options selected=$template_selected}
</select>
@@ -224,8 +226,8 @@
<tr>
<td>{'language'|@translate}</td>
<td>
- <label><input type="radio" name="language_action" value="leave" checked="checked"> {'leave'|@translate}</label>
- <label><input type="radio" name="language_action" value="set" id="language_action_set"> {'set to'|@translate}</label>
+ <label><input type="radio" name="language_action" value="leave" checked="checked" /> {'leave'|@translate}</label>
+ <label><input type="radio" name="language_action" value="set" id="language_action_set" /> {'set to'|@translate}</label>
<select onchange="document.getElementById('language_action_set').checked = true;" name="language" size="1">
{html_options options=$language_options selected=$language_selected}
</select>
@@ -235,51 +237,51 @@
<tr>
<td>{'recent_period'|@translate}</td>
<td>
- <label><input type="radio" name="recent_period_action" value="leave" checked="checked"> {'leave'|@translate}</label>
- <label><input type="radio" name="recent_period_action" value="set" id="recent_period_action_set"> {'set to'|@translate}</label>
+ <label><input type="radio" name="recent_period_action" value="leave" checked="checked" /> {'leave'|@translate}</label>
+ <label><input type="radio" name="recent_period_action" value="set" id="recent_period_action_set" /> {'set to'|@translate}</label>
<input onmousedown="document.getElementById('recent_period_action_set').checked = true;"
- type="text" size="3" maxlength="2" name="recent_period" value="{$RECENT_PERIOD}">
+ type="text" size="3" maxlength="2" name="recent_period" value="{$RECENT_PERIOD}" />
</td>
</tr>
<tr>
<td>{'auto_expand'|@translate}</td>
<td>
- <label><input type="radio" name="expand" value="leave" checked="checked"> {'leave'|@translate}</label>
+ <label><input type="radio" name="expand" value="leave" checked="checked" /> {'leave'|@translate}</label>
/ {'set to'|@translate}
- <label><input type="radio" name="expand" value="true">{'Yes'|@translate}</label>
- <label><input type="radio" name="expand" value="false">{'No'|@translate}</label>
+ <label><input type="radio" name="expand" value="true" />{'Yes'|@translate}</label>
+ <label><input type="radio" name="expand" value="false" />{'No'|@translate}</label>
</td>
</tr>
<tr>
<td>{'show_nb_comments'|@translate}</td>
<td>
- <label><input type="radio" name="show_nb_comments" value="leave" checked="checked"> {'leave'|@translate}</label>
+ <label><input type="radio" name="show_nb_comments" value="leave" checked="checked" /> {'leave'|@translate}</label>
/ {'set to'|@translate}
- <label><input type="radio" name="show_nb_comments" value="true">{'Yes'|@translate}</label>
- <label><input type="radio" name="show_nb_comments" value="false">{'No'|@translate}</label>
+ <label><input type="radio" name="show_nb_comments" value="true" />{'Yes'|@translate}</label>
+ <label><input type="radio" name="show_nb_comments" value="false" />{'No'|@translate}</label>
</td>
</tr>
<tr>
<td>{'show_nb_hits'|@translate}</td>
<td>
- <label><input type="radio" name="show_nb_hits" value="leave" checked="checked"> {'leave'|@translate}</label>
+ <label><input type="radio" name="show_nb_hits" value="leave" checked="checked" /> {'leave'|@translate}</label>
/ {'set to'|@translate}
- <label><input type="radio" name="show_nb_hits" value="true">{'Yes'|@translate}</label>
- <label><input type="radio" name="show_nb_hits" value="false">{'No'|@translate}</label>
+ <label><input type="radio" name="show_nb_hits" value="true" />{'Yes'|@translate}</label>
+ <label><input type="radio" name="show_nb_hits" value="false" />{'No'|@translate}</label>
</td>
</tr>
<tr>
<td>{'maxwidth'|@translate}</td>
<td>
- <label><input type="radio" name="maxwidth_action" value="leave" checked="checked"> {'leave'|@translate}</label>
- <label><input type="radio" name="maxwidth_action" value="unset"> {'unset'|@translate}</label>
- <label><input type="radio" name="maxwidth_action" value="set" id="maxwidth_action_set"> {'set to'|@translate}</label>
+ <label><input type="radio" name="maxwidth_action" value="leave" checked="checked" /> {'leave'|@translate}</label>
+ <label><input type="radio" name="maxwidth_action" value="unset" /> {'unset'|@translate}</label>
+ <label><input type="radio" name="maxwidth_action" value="set" id="maxwidth_action_set" /> {'set to'|@translate}</label>
<input onmousedown="document.getElementById('maxwidth_action_set').checked = true;"
- type="text" size="4" maxlength="4" name="maxwidth" value="{$MAXWIDTH}">
+ type="text" size="4" maxlength="4" name="maxwidth" value="{$MAXWIDTH}" />
</td>
</tr>
@@ -287,11 +289,11 @@
<tr>
<td>{'maxheight'|@translate}</td>
<td>
- <label><input type="radio" name="maxheight_action" value="leave" checked="checked"> {'leave'|@translate}</label>
- <label><input type="radio" name="maxheight_action" value="unset"> {'unset'|@translate}</label>
- <label><input type="radio" name="maxheight_action" value="set" id="maxheight_action_set"> {'set to'|@translate}</label>
+ <label><input type="radio" name="maxheight_action" value="leave" checked="checked" /> {'leave'|@translate}</label>
+ <label><input type="radio" name="maxheight_action" value="unset" /> {'unset'|@translate}</label>
+ <label><input type="radio" name="maxheight_action" value="set" id="maxheight_action_set" /> {'set to'|@translate}</label>
<input onmousedown="document.getElementById('maxheight_action_set').checked = true;"
- type="text" size="4" maxlength="4" name="maxheight" value="{$MAXHEIGHT}">
+ type="text" size="4" maxlength="4" name="maxheight" value="{$MAXHEIGHT}" />
</td>
</tr>
@@ -302,13 +304,13 @@
<p>
{'target'|@translate}
- <label><input type="radio" name="target" value="all"> {'all'|@translate}</label>
- <label><input type="radio" name="target" value="selection" checked="checked"> {'selection'|@translate}</label>
+ <label><input type="radio" name="target" value="all" /> {'all'|@translate}</label>
+ <label><input type="radio" name="target" value="selection" checked="checked" /> {'selection'|@translate}</label>
</p>
<p>
- <input class="submit" type="submit" value="{'Submit'|@translate}" name="pref_submit" {$TAG_INPUT_ENABLED}>
- <input class="submit" type="reset" value="{'Reset'|@translate}" name="pref_reset">
+ <input class="submit" type="submit" value="{'Submit'|@translate}" name="pref_submit" {$TAG_INPUT_ENABLED} />
+ <input class="submit" type="reset" value="{'Reset'|@translate}" name="pref_reset" />
</p>
</form>
diff --git a/admin/user_list.php b/admin/user_list.php
index 0461c83ba..454c96d29 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -185,19 +185,38 @@ $page['direction_items'] = array(
if (isset($_POST['submit_add']))
{
- $page['errors'] = register_user(
- $_POST['login'], $_POST['password'], $_POST['email'], false);
-
- if (count($page['errors']) == 0)
- {
- array_push(
- $page['infos'],
- sprintf(
- l10n('user "%s" added'),
- $_POST['login']
- )
- );
- }
+ if(empty($_POST['password']))
+ {
+ array_push($page['errors'], l10n('Password is missing'));
+ }
+ else if(empty($_POST['password_conf']))
+ {
+ array_push($page['errors'], l10n('Password confirmation is missing'));
+ }
+ else if(empty($_POST['email']))
+ {
+ array_push($page['errors'], l10n('Email address is missing'));
+ }
+ else if ($_POST['password'] != $_POST['password_conf'])
+ {
+ array_push($page['errors'], l10n('Password confirmation error'));
+ }
+ else
+ {
+ $page['errors'] = register_user(
+ $_POST['login'], $_POST['password'], $_POST['email'], false);
+
+ if (count($page['errors']) == 0)
+ {
+ array_push(
+ $page['infos'],
+ sprintf(
+ l10n('user "%s" added'),
+ $_POST['login']
+ )
+ );
+ }
+ }
}
// +-----------------------------------------------------------------------+
@@ -589,7 +608,7 @@ $navbar = create_navigation_bar(
$conf['users_page']
);
-$template->assign('navbar', $navbar);
+$template->assign('NAVBAR', $navbar);
// +-----------------------------------------------------------------------+
// | user list |
@@ -658,12 +677,12 @@ foreach ($visible_user_list as $local_user)
'U_PERM' => $perm_url.$local_user['id'],
'USERNAME' => $local_user['username']
.($local_user['id'] == $conf['guest_id']
- ? '<br>['.l10n('is_the_guest').']' : '')
+ ? '<BR />['.l10n('is_the_guest').']' : '')
.($local_user['id'] == $conf['default_user_id']
- ? '<br>['.l10n('is_the_default').']' : ''),
+ ? '<BR />['.l10n('is_the_default').']' : ''),
'STATUS' => l10n('user_status_'.
$local_user['status']).(($local_user['adviser'] == 'true')
- ? '<br>['.l10n('adviser').']' : ''),
+ ? '<BR />['.l10n('adviser').']' : ''),
'EMAIL' => get_email_address_as_display_text($local_user['email']),
'GROUPS' => $groups_string,
'PROPERTIES' => implode( ', ', $properties),