mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Allow importing of avatars via Media-Manager. Allow editing of admin perms=0 in admin users.
This commit is contained in:
@@ -2425,6 +2425,10 @@ class media_admin_ui extends e_admin_ui
|
||||
|
||||
// <td>".$frm->textarea('batch_import_diz['.$c.']', ($_POST['batch_import_diz'][$c] ? $_POST['batch_import_diz'][$c] : $default['description']))."</td>
|
||||
|
||||
|
||||
$this->cats['_avatars_public'] = "Avatars Folder (user selectable)";
|
||||
$this->cats['_avatars_private'] = "Avatars Folder (private)";
|
||||
|
||||
if(!isset($_POST['batch_category']) && substr($lastMime,0,5)=='image')
|
||||
{
|
||||
$_POST['batch_category'] = "_common_image";
|
||||
@@ -2582,10 +2586,25 @@ class media_admin_ui extends e_admin_ui
|
||||
|
||||
foreach($_POST['batch_selected'] as $key=>$file)
|
||||
{
|
||||
|
||||
// $oldpath = e_MEDIA."temp/".$file;
|
||||
$oldpath = e_IMPORT.$file;
|
||||
|
||||
$oldpath = e_IMPORT.$file;
|
||||
|
||||
if($_POST['batch_category'] == '_avatars_public' || $_POST['batch_category'] == '_avatars_private')
|
||||
{
|
||||
$newpath = ($_POST['batch_category'] == '_avatars_public') ? e_AVATAR_DEFAULT.$file : $newpath = e_AVATAR_UPLOAD.$file;
|
||||
|
||||
if(rename($oldpath,$newpath))
|
||||
{
|
||||
$mes->addSuccess(IMALAN_128." ".$newpath);
|
||||
}
|
||||
else
|
||||
{
|
||||
$mes->addError(IMALAN_128." ".$newpath);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Resize on Import Routine ------------------------
|
||||
if(vartrue($img_import_w) && vartrue($img_import_h))
|
||||
{
|
||||
|
@@ -2319,9 +2319,12 @@ class users_admin_form_ui extends e_admin_form_ui
|
||||
|
||||
function user_perms($curval,$mode)
|
||||
{
|
||||
if($mode == 'read')
|
||||
$perms = $this->getController()->getModel()->get('user_perms');
|
||||
$uid = $this->getController()->getModel()->get('user_id');
|
||||
|
||||
if($mode == 'read' || (str_replace(".","",$perms) == '0' && $uid == USERID))
|
||||
{
|
||||
$uid = $this->getController()->getModel()->get('user_id');
|
||||
|
||||
return e107::getUserPerms()->renderPerms($curval,$uid);
|
||||
}
|
||||
if($mode == 'write')
|
||||
@@ -2494,13 +2497,15 @@ class users_admin_form_ui extends e_admin_form_ui
|
||||
|
||||
$opts = array();
|
||||
|
||||
$opts['usersettings'] = LAN_EDIT;
|
||||
|
||||
if ($row['user_perms'] != "0")
|
||||
{
|
||||
// disabled user info <option value='userinfo'>".USRLAN_80."</option>
|
||||
// $text .= "<option value='usersettings'>".LAN_EDIT."</option>";
|
||||
|
||||
|
||||
$opts['usersettings'] = LAN_EDIT;
|
||||
|
||||
|
||||
// login/logout As
|
||||
if(getperms('0') && !($row['user_admin'] && getperms('0', $row['user_perms'])))
|
||||
|
Reference in New Issue
Block a user