Skip to content

Commit

Permalink
feature 3083: return the upload_file_types in pwg.session.getStatus (…
Browse files Browse the repository at this point in the history
…list of file extension, comma separated)

git-svn-id: http://piwigo.org/svn/trunk@29729 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Sep 22, 2014
1 parent 765feec commit 4dbf817
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion include/ws_functions/pwg.php
Expand Up @@ -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 )
Expand All @@ -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;
}

Expand Down

0 comments on commit 4dbf817

Please sign in to comment.