aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2006-07-11 20:51:24 +0000
committerrub <rub@piwigo.org>2006-07-11 20:51:24 +0000
commit8a7fff22b0ada393cff2543fbf17c0cf52f0d03d (patch)
tree2d8f5a667fa1199708aedec7e0e6835fc3a90640
parentcfcb489cfa131a56e057e358b7041a7dd6dd71ab (diff)
Resolved Issue ID 0000456, 0000457, 0000459, 0000465:
o Fix bugs adviser mode git-svn-id: http://piwigo.org/svn/trunk@1458 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/notification_by_mail.php14
-rw-r--r--admin/rating.php2
-rw-r--r--admin/site_manager.php2
-rw-r--r--admin/site_update.php3
-rw-r--r--admin/user_list.php2
-rw-r--r--admin/waiting.php2
-rw-r--r--include/functions_user.inc.php19
-rwxr-xr-xtemplate/yoga/admin/rating.tpl2
-rw-r--r--template/yoga/admin/site_manager.tpl10
9 files changed, 42 insertions, 14 deletions
diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php
index dbb3a80a6..1a3efeabc 100644
--- a/admin/notification_by_mail.php
+++ b/admin/notification_by_mail.php
@@ -171,7 +171,15 @@ order by
)
);
- array_push($page['infos'], sprintf(l10n('nbm_user_x_added'), $nbm_user['username'], $nbm_user['mail_address']));
+ array_push
+ (
+ $page['infos'],
+ sprintf(
+ l10n('nbm_user_x_added'),
+ $nbm_user['username'],
+ get_email_address_as_display_text($nbm_user['mail_address'])
+ )
+ );
}
// Insert new nbm_users
@@ -579,7 +587,7 @@ switch ($page['mode'])
: (isset($_POST['trueify']) and isset($_POST['cat_false']) and in_array($nbm_user['check_key'], $_POST['cat_false']))
) ? 'selected="selected"' : '',
'VALUE' => $nbm_user['check_key'],
- 'OPTION' => $nbm_user['username'].'['.$nbm_user['mail_address'].']'
+ 'OPTION' => $nbm_user['username'].'['.get_email_address_as_display_text($nbm_user['mail_address']).']'
));
}
@@ -621,7 +629,7 @@ switch ($page['mode'])
!in_array($nbm_user['check_key'], $_POST['send_selection']) // not selected
) ? '' : 'checked="checked"',
'USERNAME'=> $nbm_user['username'],
- 'EMAIL' => $nbm_user['mail_address'],
+ 'EMAIL' => get_email_address_as_display_text($nbm_user['mail_address']),
'LAST_SEND'=> $nbm_user['last_send']
));
}
diff --git a/admin/rating.php b/admin/rating.php
index 21850d5df..45d62c64d 100644
--- a/admin/rating.php
+++ b/admin/rating.php
@@ -74,7 +74,7 @@ if (isset($_GET['users']))
}
}
-if (isset($_GET['del']))
+if (isset($_GET['del']) and !is_adviser())
{
$del_params = urldecode( $_GET['del'] );
parse_str($del_params, $vars);
diff --git a/admin/site_manager.php b/admin/site_manager.php
index 6e53bb55b..c13b9857c 100644
--- a/admin/site_manager.php
+++ b/admin/site_manager.php
@@ -162,7 +162,7 @@ if (isset($_GET['site']) and is_numeric($_GET['site']))
{
$page['site'] = $_GET['site'];
}
-if (isset($_GET['action']) and isset($page['site']) )
+if (isset($_GET['action']) and isset($page['site']) and !is_adviser())
{
$query = '
SELECT galleries_url
diff --git a/admin/site_update.php b/admin/site_update.php
index 336d3ff26..baf7131af 100644
--- a/admin/site_update.php
+++ b/admin/site_update.php
@@ -111,8 +111,9 @@ if (isset($_POST['submit']))
{
$general_failure = false;
}
+
// shall we simulate only
- if (isset($_POST['simulate']) and $_POST['simulate'] == 1)
+ if ((isset($_POST['simulate']) and $_POST['simulate'] == 1) or is_adviser())
{
$simulate = true;
}
diff --git a/admin/user_list.php b/admin/user_list.php
index 9df0f3f0e..735be89b7 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -823,7 +823,7 @@ foreach ($page['filtered_users'] as $num => $local_user)
'U_PERM' => $perm_url.$local_user['id'],
'USERNAME' => $local_user['username'],
'STATUS' => $lang['user_status_'.$local_user['status']].(($local_user['adviser'] == 'true') ? ' ['.$lang['adviser'].']' : ''),
- 'EMAIL' => isset($local_user['email']) ? $local_user['email'] : '',
+ 'EMAIL' => isset($local_user['email']) ? get_email_address_as_display_text($local_user['email']) : '',
'GROUPS' => $groups_string,
'PROPERTIES' => (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true')) ? $lang['is_high_enabled'] : $lang['is_high_disabled']
)
diff --git a/admin/waiting.php b/admin/waiting.php
index af4cb607f..b5cfb13b5 100644
--- a/admin/waiting.php
+++ b/admin/waiting.php
@@ -195,7 +195,7 @@ while ( $row = mysql_fetch_array( $result ) )
(strlen($row['file']) > 10) ?
(substr($row['file'], 0, 10)).'...' : $row['file'],
'PREVIEW_URL_IMG'=>$preview_url,
- 'UPLOAD_EMAIL'=>$row['mail_address'],
+ 'UPLOAD_EMAIL'=>get_email_address_as_display_text($row['mail_address']),
'UPLOAD_USERNAME'=>$row['username']
)
);
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index a2ca7086e..a801fbc19 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -647,4 +647,23 @@ function is_adviser()
return ($user['adviser'] == 'true');
}
+
+/*
+ * Return mail address as display text
+ * @return string
+*/
+function get_email_address_as_display_text($email_address)
+{
+ global $conf;
+
+ if (is_adviser())
+ {
+ return 'adviser.mode@'.$_SERVER['SERVER_NAME'];
+ }
+ else
+ {
+ return $email_address;
+ }
+}
+
?>
diff --git a/template/yoga/admin/rating.tpl b/template/yoga/admin/rating.tpl
index ac78bf419..d5efdfbab 100755
--- a/template/yoga/admin/rating.tpl
+++ b/template/yoga/admin/rating.tpl
@@ -58,7 +58,7 @@
<td>{image.rate.RATE}</td>
<td><b>{image.rate.USER}</b></td>
<td><span class="date">{image.rate.DATE}</span></td>
- <td><a href="{image.rate.U_DELETE}"><img src="{themeconf:icon_dir}/delete.png" class="button" style="border:none;vertical-align:middle; margin-left:5px;" alt="[{lang:delete}]"/></a></td>
+ <td><a href="{image.rate.U_DELETE}" {TAG_INPUT_ENABLED}><img src="{themeconf:icon_dir}/delete.png" class="button" style="border:none;vertical-align:middle; margin-left:5px;" alt="[{lang:delete}]"/></a></td>
</tr>
<!-- END rate -->
<!-- END image -->
diff --git a/template/yoga/admin/site_manager.tpl b/template/yoga/admin/site_manager.tpl
index 88b77a362..0168bb078 100644
--- a/template/yoga/admin/site_manager.tpl
+++ b/template/yoga/admin/site_manager.tpl
@@ -24,7 +24,7 @@
{lang:remote_site_local_create}:
<input type="hidden" name="no_check" value="1"/>
<input type="hidden" name="galleries_url" value="{local_listing.URL}" />
- <input type="submit" name="submit" value="{lang:submit}"/>
+ <input type="submit" name="submit" value="{lang:submit}" {TAG_INPUT_ENABLED} />
</p>
</form>
<!-- END create -->
@@ -42,13 +42,13 @@
[<a href="{sites.site.U_SYNCHRONIZE}" title="{lang:site_synchronize_hint}">{lang:site_synchronize}</a>]
<!-- BEGIN delete -->
[<a href="{sites.site.delete.U_DELETE}" onclick="return confirm('{lang:Are you sure?}');"
- title="{lang:site_delete_hint}">{lang:site_delete}</a>]
+ title="{lang:site_delete_hint}" {TAG_INPUT_ENABLED}>{lang:site_delete}</a>]
<!-- END delete -->
<!-- BEGIN remote -->
<br>
- [<a href="{sites.site.remote.U_TEST}" title="{lang:remote_site_test_hint}">{lang:remote_site_test}</a>]
- [<a href="{sites.site.remote.U_GENERATE}" title="{lang:remote_site_generate_hint}">{lang:remote_site_generate}</a>]
- [<a href="{sites.site.remote.U_CLEAN}" title="{lang:remote_site_clean_hint}">{lang:remote_site_clean}</a>]
+ [<a href="{sites.site.remote.U_TEST}" title="{lang:remote_site_test_hint}" {TAG_INPUT_ENABLED}>{lang:remote_site_test}</a>]
+ [<a href="{sites.site.remote.U_GENERATE}" title="{lang:remote_site_generate_hint}" {TAG_INPUT_ENABLED}>{lang:remote_site_generate}</a>]
+ [<a href="{sites.site.remote.U_CLEAN}" title="{lang:remote_site_clean_hint}" {TAG_INPUT_ENABLED}>{lang:remote_site_clean}</a>]
<!-- END remote -->
</td></tr>
<!-- END site -->