Beispiel #1
0
 /**
  *
  */
 public static function fix_permissionsHelp()
 {
     return _t("CollectiveAccess must have both read and write access to the temporary storage directory (app/tmp), media directory (media) and HTMLPurifier definition cache (app/lib/core/Parsers/htmlpurifier/standalone/HTMLPurifier/DefinitionCache). A run-time error will be displayed if any of these locations is not accessible to the application. To change these permissions to allow CollectiveAccess to run normally run this command while logged in with administrative/root privileges. You are currently logged in as %1 (uid %2). You can specify which user will be given ownership of the directories using the --user option. If you do not specify a user, the web server user for your server will be automatically determined and used.", caGetProcessUserName(), caGetProcessUserID());
 }
/**
 *
 */
function caDetermineWebServerUser()
{
    if (!caIsRunFromCLI() && ($vs_user = caGetProcessUserName())) {
        // we're running on the web server
        return $vs_user;
    }
    if (function_exists("posix_getpwnam")) {
        // Not running in web server so try to guess
        foreach (array('apache', 'www-data', 'www', 'httpd', 'nobody') as $vs_possible_user) {
            if (posix_getpwnam($vs_possible_user)) {
                return $vs_possible_user;
            }
        }
    }
    return null;
}