Re: default_user settings in file manager - thoughts?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/8/07, Ken A <ka@xxxxxxxxxxx> wrote:
> I don't have a clean patch for this.. apologies in advance.

diff -u old_file new_file
diff -ur old_dir new_dir

:-)

Seriously, unified diffs are a lot more helpful for reviewing and
integrating into the development code.

> What this does is change the way the file manager plugin config file
> works, allows a 'default_user' config line that is used if the username
> isn't specified already. This way you can set a default quota limit and
> file root for file manager and you don't have to specify every user. It
> also creates the users' directory upon login. This requires a small
> change in file_manager.php and a larger change in functions.php.
>
> In file_manager.users (the config file) you can add a line at the BOTTOM
> of the file like so:
>
> default_user /var/local/squirrelmail/files 40MB x@xxxxx 0 0 0
>
> The $username will get appended to the path for the user's base dir.

That should be made configurable IMO.

> The base dir will get auto created upon login. It'll only be used if the
> user isn't specified already in the config file ABOVE the default_user.
>
> This isn't for everybody, but may be appropriate in some environments,
> and this code has not been heavily tested yet.

Thanks.  I will add this to the new version.  This plugin's been on
the back-burner for a long time, and still will be pending my paid
work, but it's not lost forever.

Thanks,
paul

>
> -------------------------------------------------
> file_manager.php:
>
> just before line 1882, add this:
>     // create the dir if it doesn't exist
>     // this might be very unsafe thing to do..
>     // you have been warned!
>     if((!is_dir($cwd)) && ($cwd == $baseDir))
>          mkdir($cwd, intval($defaultFolderPerms, 8));
>
>     if ($DIR = opendir($cwd))     // line 1882
>
> --------------------------------------------------
>
>
> functions.php:
>
> Right below the '}' on line 173, add this:
>
> // this is a duplication of the if(){ ... } above
> // but with the $username used to set a single basedir
> elseif ($configSettings[1][0] == 'default_user')
> {
>   $numberOfFields = sizeof($configSettings[1]);
>   $file_manager_user_config[$username]['allowEditBinary'] =
> $configSettings[1][$numberOfFields - 1];
>   $file_manager_user_config[$username]['allowChmod'] =
> $configSettings[1][$numberOfFields - 2];
>   $file_manager_user_config[$username]['allowLinks'] =
> $configSettings[1][$numberOfFields - 3];
>   $file_manager_user_config[$username]['adminMail'] =
> $configSettings[1][$numberOfFields - 4];
>
>   $numberOfBaseDirs = 1;
>   for ( ; $numberOfBaseDirs < $numberOfFields - 5; $numberOfBaseDirs++)
>   {
>    $file_manager_user_config[$username]['baseDir1'] =
> $configSettings[1][1] . '/' . $username;
>   }
>   $quota = $configSettings[1][$numberOfFields - 5];
>   if (is_numeric($quota) || is_numeric(get_real_size($quota)))
>   {
>    $file_manager_user_config[$username]['quota'] = $quota;
>    $numberOfBaseDirs--;
>   }
>   else
>   {
>    $file_manager_user_config[$username]['baseDir' . $numberOfBaseDirs] =
> $quota;
>    $file_manager_user_config[$username]['quota'] = '';
>   }
>   $foundUserConfig = 1;
>   break;
> } // end of default_user elseif
>
> ----------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
--
squirrelmail-users mailing list
Posting Guidelines: http://www.squirrelmail.org/wiki/MailingListPostingGuidelines
List Address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
List Archives:  http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux