aboutsummaryrefslogtreecommitdiffstats
path: root/include/ws_functions
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2014-09-22 09:29:00 +0000
committerplegall <plg@piwigo.org>2014-09-22 09:29:00 +0000
commit4dbf817829c5d66bd5da434062d12a7c33e57d22 (patch)
treec1f356fbe17929d87e392bc4035d885e0d697c7c /include/ws_functions
parent765feec9ea2de31ccb6200e227f773329f33a249 (diff)
feature 3083: return the upload_file_types in pwg.session.getStatus (list of file extension, comma separated)
git-svn-id: http://piwigo.org/svn/trunk@29729 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/ws_functions')
-rw-r--r--include/ws_functions/pwg.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/ws_functions/pwg.php b/include/ws_functions/pwg.php
index d94d7a1a8..b96338eaf 100644
--- a/include/ws_functions/pwg.php
+++ b/include/ws_functions/pwg.php
@@ -314,7 +314,7 @@ function ws_session_logout($params, &$service)
*/
function ws_session_getStatus($params, &$service)
{
- global $user;
+ global $user, $conf;
$res['username'] = is_a_guest() ? 'guest' : stripslashes($user['username']);
foreach ( array('status', 'theme', 'language') as $k )
@@ -327,6 +327,20 @@ function ws_session_getStatus($params, &$service)
list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();'));
$res['current_datetime'] = $dbnow;
$res['version'] = PHPWG_VERSION;
+
+ if (is_admin())
+ {
+ $res['upload_file_types'] = implode(
+ ',',
+ array_unique(
+ array_map(
+ 'strtolower',
+ $conf['upload_form_all_types'] ? $conf['file_ext'] : $conf['picture_ext']
+ )
+ )
+ );
+ }
+
return $res;
}