Пример #1
0
function AutoRespond($s_to, $s_subj, $a_values)
{
    global $aPHPVERSION, $SPECIAL_VALUES, $FROM_USER;
    //
    // need PHP 4.0.5 for the preg_replace_callback function
    //
    if (!IsPHPAtLeast("4.0.5")) {
        SendAlert(GetMessage(MSG_PHP_AUTORESP, array("PHPVERS" => implode(".", $aPHPVERSION))));
        return false;
    }
    $a_headers = array();
    $s_mail_text = "";
    $s_from_addr = "";
    if (isset($FROM_USER) && !empty($FROM_USER)) {
        if ($FROM_USER != "NONE") {
            $s_from_addr = $a_headers['From'] = $FROM_USER;
        }
    } else {
        global $SERVER;
        $s_from_addr = "FormMail@" . $SERVER;
        $a_headers['From'] = $s_from_addr;
    }
    if (IsAROptionSet('PlainTemplate')) {
        $s_template = GetAROption("PlainTemplate");
        if (!ProcessTemplate($s_template, $a_lines, $a_values, GetAROption('TemplateMissing'), 'SubstituteValuePlain')) {
            return false;
        }
        $s_mail_text = implode(BODY_LF, $a_lines);
    }
    if (IsAROptionSet("HTMLTemplate")) {
        if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLTemplate"), GetAROption('TemplateMissing'))) {
            return false;
        }
    }
    return SendCheckedMail($s_to, $s_subj, $s_mail_text, $s_from_addr, $a_headers);
}
Пример #2
0
    $appEngine->forwardInvalidModule(true);
}
$appEngine->checkUserAuthentication(true, ACL_MOD_GROUP, ACL_ACTION_ASSIGN);
// Load language.
$appTR->loadModule("groupassign");
// Form request.
$assign = check_request_var('assign');
if ($assign) {
    $appEngine->handleAction('assign_togroup');
}
// User list.
$users = null;
if ($appEngine->isUserViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_USER, ACL_ACTION_VIEW)) {
    $users = $appEngine->getUserViewProvider()->getUsers();
    // Remove the * user from array.
    $o = new \svnadmin\core\entities\User();
    $o->id = '*';
    $o->name = '*';
    $users = remove_item_by_value($users, $o, true);
    usort($users, array('\\svnadmin\\core\\entities\\User', "compare"));
}
// Group list.
$groups = null;
if ($appEngine->isGroupViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_GROUP, ACL_ACTION_VIEW)) {
    $groups = $appEngine->getGroupViewProvider()->getGroups();
    usort($groups, array('\\svnadmin\\core\\entities\\Group', "compare"));
}
SetValue("UserList", $users);
SetValue("GroupList", $groups);
ProcessTemplate("group/membership.html.php");
Пример #3
0
}
// Access-Path permissions of the current group.
$paths = null;
if ($appEngine->isAccessPathViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_ACCESSPATH, ACL_ACTION_VIEW)) {
    $paths = $appEngine->getAccessPathViewProvider()->getPathsOfUser($oUser);
    usort($paths, array('\\svnadmin\\core\\entities\\AccessPath', "compare"));
}
// Check whether the user is an project administrator.
$restricted_paths = null;
$isprojectmanager = false;
if ($appEngine->isAuthenticationActive()) {
    $uname = $username;
    if ($appEngine->getAclManager()->isUserAccessPathManager($uname)) {
        $restricted_paths = $appEngine->getAclManager()->getAccessPathsOfUser($uname);
        if (count($restricted_paths) > 0) {
            usort($restricted_paths, array('\\svnadmin\\core\\entities\\AccessPath', "compare"));
            $isprojectmanager = true;
        }
    }
}
SetValue("RoleList", $rolesOfUser);
SetValue("RoleListAll", $allroles);
SetValue("GroupList", $groups);
SetValue("GroupListAll", $allgroups);
SetValue("PathList", $paths);
SetValue("RestrictedPathList", $restricted_paths);
SetValue("ProjectManager", $isprojectmanager);
SetValue("Username", $username);
SetValue("UsernameEncoded", rawurlencode($username));
ProcessTemplate("user/userview.html.php");
 function _SendEmail($s_to, $s_subj, $a_values, $b_use_template)
 {
     global $aPHPVERSION, $SPECIAL_VALUES, $FROM_USER;
     //
     // need PHP 4.0.5 for the preg_replace_callback function
     //
     if (!IsPHPAtLeast("4.0.5")) {
         SendAlert(GetMessage(MSG_PHP_AUTORESP, array("PHPVERS" => implode(".", $aPHPVERSION))));
         return false;
     }
     $a_headers = array();
     $s_mail_text = "";
     $s_from_addr = GetAROption("FromAddr");
     if (!isset($s_from_addr)) {
         $s_from_addr = "";
         if (isset($FROM_USER) && !empty($FROM_USER)) {
             if ($FROM_USER != "NONE") {
                 $s_from_addr = $FROM_USER;
             }
         } else {
             global $SERVER;
             $s_from_addr = "FormMail@" . $SERVER;
         }
     } else {
         $s_from_addr = UnMangle($s_from_addr);
     }
     if (!empty($s_from_addr)) {
         $a_headers['From'] = SafeHeader($s_from_addr);
     }
     $s_type = "";
     if ($b_use_template) {
         if (IsAROptionSet('PlainTemplate')) {
             $s_type .= "PlainTemplate ";
             $s_template = GetAROption("PlainTemplate");
             if (!ProcessTemplate($s_template, $a_lines, $a_values, GetAROption('TemplateMissing'), 'SubstituteValuePlain')) {
                 return false;
             }
             FMDebug("AutoRespond: PlainTemplate " . count($a_lines) . " lines");
             $s_mail_text = implode(BODY_LF, $a_lines);
         }
         if (IsAROptionSet("HTMLTemplate")) {
             $s_type .= "HTMLTemplate ";
             if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLTemplate"), GetAROption('TemplateMissing'))) {
                 return false;
             }
             FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes");
         }
     } else {
         global $TEMPLATEURL, $TEMPLATEDIR;
         if (IsAROptionSet('PlainFile')) {
             $s_type .= "PlainFile ";
             //
             // load the plain text file from the templates area
             //
             if (empty($TEMPLATEDIR) && empty($TEMPLATEURL)) {
                 SendAlert(GetMessage(MSG_TEMPLATES));
                 return false;
             }
             $s_file = GetAROption("PlainFile");
             if (($a_lines = LoadTemplate($s_file, $TEMPLATEDIR, $TEMPLATEURL, true)) === false) {
                 return false;
             }
             $s_mail_text = implode(BODY_LF, $a_lines);
             FMDebug("AutoRespond: PlainFile " . count($a_lines) . " lines");
         }
         if (IsAROptionSet("HTMLFile")) {
             $s_type .= "HTMLFile ";
             if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLFile"), "", false, "", array(), array(), false)) {
                 return false;
             }
             FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes");
         }
     }
     if (strlen($s_mail_text) == 0) {
         SendAlert(GetMessage(MSG_ARESP_EMPTY), array("TYPE" => $s_type));
     }
     FMDebug("AutoRespond: message is " . strlen($s_mail_text) . " bytes");
     return SendCheckedMail($s_to, $s_subj, $s_mail_text, $s_from_addr, $a_headers);
 }
Пример #5
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.
 */
include "include/config.inc.php";
$appEngine->forwardInvalidModule(!$appEngine->isAccessPathEditActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_ACCESSPATH, ACL_ACTION_ADD);
$appTR->loadModule("accesspathcreate");
// Form request to create the user
$create = check_request_var('create');
if ($create) {
    $appEngine->handleAction('create_accesspath');
}
// HTTP request parameters.
$varRepoEnc = get_request_var("r");
$varPathEnc = get_request_var("p");
$varRepo = rawurldecode($varRepoEnc);
$varPath = rawurldecode($varPathEnc);
// Stick together the pre-value of the input field.
$preFill = "";
if ($varRepo != NULL) {
    $preFill = $varRepo . ":/";
    if ($varPath != NULL) {
        $preFill .= $varPath;
    }
}
SetValue("DefaultAccessPath", $preFill);
ProcessTemplate("accesspath/accesspathcreate.html.php");
Пример #6
0
$list = array();
$users = array();
try {
    // All AccessPaths.
    $list = $appEngine->getAccessPathViewProvider()->getPaths();
    usort($list, array('\\svnadmin\\core\\entities\\AccessPath', "compare"));
    // Filter access-paths for project-managers.
    if ($appEngine->isAuthenticationActive()) {
        $currentUsername = $appEngine->getSessionUsername();
        if ($appEngine->getAclManager()->isUserAccessPathManager($currentUsername)) {
            $list = $appEngine->getAclManager()->filterAccessPathsList($currentUsername, $list);
        }
        // Load list of users to create a combobox and assign them as project managers to paths.
        if ($appEngine->isUserViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_PROJECTMANAGER, ACL_ACTION_ASSIGN)) {
            $users = $appEngine->getUserViewProvider()->getUsers(false);
            usort($users, array('\\svnadmin\\core\\entities\\User', "compare"));
        }
        // Get the project managers of each path.
        $listCount = count($list);
        for ($i = 0; $i < $listCount; $i++) {
            $managers = $appEngine->getAclManager()->getUsersOfAccessPath($list[$i]->path);
            $list[$i]->managers = $managers;
        }
    }
} catch (Exception $ex) {
    $appEngine->addException($ex);
}
SetValue("UserList", $users);
SetValue("AccessPathList", $list);
ProcessTemplate("accesspath/accesspathlist.html.php");
Пример #7
0
 function _SendEmail($s_to, $s_subj, $a_values, $b_use_template)
 {
     global $SPECIAL_VALUES;
     $a_headers = array();
     $s_mail_text = "";
     $s_from_addr = GetAROption("FromAddr");
     if (!isset($s_from_addr)) {
         $s_from_addr = "";
         if (!Settings::isEmpty('FROM_USER')) {
             if (Settings::get('FROM_USER') != "NONE") {
                 $s_from_addr = Settings::get('FROM_USER');
             }
         } else {
             global $SERVER;
             $s_from_addr = "FormMail@" . $SERVER;
         }
     } else {
         $s_from_addr = UnMangle($s_from_addr);
     }
     if (!empty($s_from_addr)) {
         $a_headers['From'] = SafeHeader($s_from_addr);
     }
     $s_type = "";
     if ($b_use_template) {
         if (IsAROptionSet('PlainTemplate')) {
             $s_type .= "PlainTemplate ";
             $s_template = GetAROption("PlainTemplate");
             if (!ProcessTemplate($s_template, $a_lines, $a_values, GetAROption('TemplateMissing'), 'SubstituteValuePlain')) {
                 return false;
             }
             FMDebug("AutoRespond: PlainTemplate " . count($a_lines) . " lines");
             $s_mail_text = implode(Settings::get('BODY_LF'), $a_lines);
         }
         if (IsAROptionSet("HTMLTemplate")) {
             $s_type .= "HTMLTemplate ";
             if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLTemplate"), GetAROption('TemplateMissing'))) {
                 return false;
             }
             FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes");
         }
     } else {
         if (IsAROptionSet('PlainFile')) {
             $s_type .= "PlainFile ";
             //
             // load the plain text file from the templates area
             //
             if (Settings::isEmpty('TEMPLATEDIR') && Settings::isEmpty('TEMPLATEURL')) {
                 SendAlert(GetMessage(MSG_TEMPLATES));
                 return false;
             }
             $s_file = GetAROption("PlainFile");
             if (($a_lines = LoadTemplate($s_file, Settings::get('TEMPLATEDIR'), Settings::get('TEMPLATEURL'), true)) === false) {
                 return false;
             }
             $s_mail_text = implode(Settings::get('BODY_LF'), $a_lines);
             FMDebug("AutoRespond: PlainFile " . count($a_lines) . " lines");
         }
         if (IsAROptionSet("HTMLFile")) {
             $s_type .= "HTMLFile ";
             if (!MakeMimeMail($s_mail_text, $a_headers, $a_values, GetAROption("HTMLFile"), "", false, "", array(), array(), false)) {
                 return false;
             }
             FMDebug("AutoRespond: HTMLTemplate " . strlen($s_mail_text) . " bytes");
         }
     }
     if (strlen($s_mail_text) == 0) {
         SendAlert(GetMessage(MSG_ARESP_EMPTY), array("TYPE" => $s_type));
     }
     FMDebug("AutoRespond: message is " . strlen($s_mail_text) . " bytes");
     return SendCheckedMail($s_to, $s_subj, $s_mail_text, $s_from_addr, $a_headers);
 }
Пример #8
0
/**
 * iF.SVNAdmin
 * Copyright (c) 2010 by Manuel Freiholz
 * http://www.insanefactory.com/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.
 */
include "include/config.inc.php";
$appEngine->forwardInvalidModule(!$appEngine->isUserEditActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_USER, ACL_ACTION_ADD);
$appTR->loadModule("usercreate");
// Action handling.
// Form request to create the user
$create = check_request_var('create');
if ($create) {
    $appEngine->handleAction('create_user');
}
ProcessTemplate("user/usercreate.html.php");
Пример #9
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.
 */
include "include/config.inc.php";
$appEngine->forwardInvalidModule(!$appEngine->isUserViewActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_USER, ACL_ACTION_VIEW);
$appTR->loadModule("userlist");
$appTR->loadModule("roles");
// Form request to delete users.
if (check_request_var("delete")) {
    $appEngine->handleAction("delete_user");
} elseif (check_request_var("assign_role")) {
    $appEngine->handleAction("assign_userrole");
}
// Assign roles.
// Get all roles to assign the user to a new role.
$allroles = null;
if ($appEngine->isAclManagerActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_ROLE, ACL_ACTION_ASSIGN)) {
    // All existing roles.
    $allroles = $appEngine->getAclManager()->getRoles();
    usort($allroles, array('\\svnadmin\\core\\entities\\Role', "compare"));
}
// Get all users and sort them by name.
$users = $appEngine->getUserViewProvider()->getUsers();
usort($users, array('\\svnadmin\\core\\entities\\User', "compare"));
SetValue("UserList", $users);
SetValue("RoleList", $allroles);
ProcessTemplate("user/userlist.html.php");
Пример #10
0
// Get required variables.
$accesspathEnc = get_request_var('accesspath');
$accesspath = rawurldecode($accesspathEnc);
// View data.
$o = new \svnadmin\core\entities\AccessPath();
$o->path = $accesspath;
$users = $appEngine->getAccessPathViewProvider()->getUsersOfPath($o);
$groups = $appEngine->getAccessPathViewProvider()->getGroupsOfPath($o);
// Data to assign new user permissions.
// Data to assign new group permissions.
if ($appEngine->isAccessPathEditActive() && $appEngine->checkUserAccess(ACL_MOD_ACCESSPATH, ACL_ACTION_ASSIGN)) {
    if ($appEngine->isUserViewActive()) {
        $allusers = $appEngine->getUserViewProvider()->getUsers();
        usort($allusers, array('\\svnadmin\\core\\entities\\User', "compare"));
        SetValue("UserListAll", $allusers);
    }
    if ($appEngine->isGroupViewActive()) {
        $allgroups = $appEngine->getGroupViewProvider()->getGroups();
        usort($allgroups, array('\\svnadmin\\core\\entities\\Group', "compare"));
        SetValue("GroupListAll", $allgroups);
    }
}
SetValue("PermNone", \svnadmin\core\entities\Permission::$PERM_NONE);
SetValue("PermRead", \svnadmin\core\entities\Permission::$PERM_READ);
SetValue("PermReadWrite", \svnadmin\core\entities\Permission::$PERM_READWRITE);
SetValue("UserList", $users);
SetValue("GroupList", $groups);
SetValue("AccessPath", $accesspath);
SetValue("AccessPathEncoded", rawurlencode($accesspath));
ProcessTemplate("accesspath/accesspathview.html.php");
Пример #11
0
 * Copyright (c) 2010 by Manuel Freiholz
 * http://www.insanefactory.com/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.
 */
include "include/config.inc.php";
$appEngine->forwardInvalidModule(!$appEngine->isGroupViewActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_GROUP, ACL_ACTION_VIEW);
$appTR->loadModule("grouplist");
// Form 'delete' request.
$delete = check_request_var('delete');
if ($delete) {
    $appEngine->handleAction('delete_group');
}
// Get all groups and sort them by name.
$groups = $appEngine->getGroupViewProvider()->getGroups();
usort($groups, array('\\svnadmin\\core\\entities\\Group', "compare"));
SetValue("GroupList", $groups);
ProcessTemplate("group/grouplist.html.php");
Пример #12
0
include "include/config.inc.php";
//
// Authentication
//
$appEngine->checkUserAuthentication();
$appTR->loadModule("errors");
//
// HTTP Request Vars
//
$e = get_request_var('e');
//
// View Data
//
$page = "";
switch ($e) {
    case ERROR_INVALID_MODULE:
        $page = "error/invalid-module.html.php";
        break;
    case ERROR_NO_ACCESS:
        $acl_module = get_request_var("m");
        $acl_action = get_request_var("a");
        $page = "error/no-access.html.php";
        SetValue("Module", $acl_module);
        SetValue("Action", $acl_action);
        break;
    default:
        $appEngine->forward(PAGE_HOME, true);
        break;
}
ProcessTemplate($page);
Пример #13
0
<?php

/**
 * iF.SVNAdmin
 * Copyright (c) 2010 by Manuel Freiholz
 * http://www.insanefactory.com/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.
 */
include "include/config.inc.php";
$appEngine->forwardInvalidModule(!$appEngine->isGroupEditActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_GROUP, ACL_ACTION_ADD);
$appTR->loadModule("groupcreate");
// Form request to create the user
$create = check_request_var('create');
if ($create) {
    $appEngine->handleAction('create_group');
}
ProcessTemplate("group/groupcreate.html.php");
Пример #14
0
// Basic view data.
$users = array();
$groups = array();
$paths = array();
if ($appEngine->isUserViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_USER, ACL_ACTION_VIEW)) {
    $users = $appEngine->getUserViewProvider()->getUsers();
    usort($users, array('\\svnadmin\\core\\entities\\User', "compare"));
}
if ($appEngine->isGroupViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_GROUP, ACL_ACTION_VIEW)) {
    $groups = $appEngine->getGroupViewProvider()->getGroups();
    usort($groups, array('\\svnadmin\\core\\entities\\Group', "compare"));
}
if (true) {
    $paths = $appEngine->getAccessPathViewProvider()->getPaths();
    // Filter access-paths for project-managers.
    if ($appEngine->isAuthenticationActive()) {
        $currentUsername = $appEngine->getSessionUsername();
        if ($appEngine->getAclManager()->isUserAccessPathManager($currentUsername)) {
            $paths = $appEngine->getAclManager()->filterAccessPathsList($currentUsername, $paths);
        }
    }
    usort($paths, array('\\svnadmin\\core\\entities\\AccessPath', "compare"));
}
SetValue("PermNone", \svnadmin\core\entities\Permission::$PERM_NONE);
SetValue("PermRead", \svnadmin\core\entities\Permission::$PERM_READ);
SetValue("PermReadWrite", \svnadmin\core\entities\Permission::$PERM_READWRITE);
SetValue("UserList", $users);
SetValue("GroupList", $groups);
SetValue("AccessPathList", $paths);
ProcessTemplate("permission/permissionassign.html.php");
Пример #15
0
            }
            if ($hasCustomWebLink) {
                $val->customWebLink = IF_StringUtils::arguments($customWebLink, $args);
            }
        }
        $itemList[] = $val;
    }
    // Create "up" link.
    // Load the user list template file and add the array of users.
    $backLinkPath = "/";
    if (empty($varPath)) {
        $varPath = "";
    } else {
        $pos = strrpos($varPath, "/");
        if ($pos !== false && $pos > 0) {
            $backLinkPath = substr($varPath, 0, $pos);
        }
    }
    SetValue("ApacheWebLink", $hasApacheWebLink);
    SetValue("CustomWebLink", $hasCustomWebLink);
    SetValue("ItemList", $itemList);
    SetValue("Repository", $oR);
    SetValue("BackLinkPath", $backLinkPath);
    SetValue("BackLinkPathEncoded", rawurlencode($backLinkPath));
    SetValue("CurrentPath", $varPath);
    SetValue("RepositoryRoot", $isRepositoryRoot);
} catch (Exception $ex) {
    $engine->addException($ex);
}
ProcessTemplate("repository/repositoryview.html.php");
Пример #16
0
<?php

include "include/config.inc.php";
//
// Authentication
//
if (!$appEngine->isAclManagerActive()) {
    $appEngine->forwardInvalidModule(true);
}
$appEngine->checkUserAuthentication(true, ACL_MOD_ROLE, ACL_ACTION_VIEW);
$appTR->loadModule("roles");
//
// View Data
//
$roles = $appEngine->getAclManager()->getRoles();
SetValue('RoleList', $roles);
ProcessTemplate('role/rolelist.html.php');
Пример #17
0
 * as published by the Free Software Foundation; version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.
 */
require_once "include/config.inc.php";
//
// Authentication
//
if (!$appEngine->isViewUpdateable() || !$appEngine->getConfig()->getValueAsBoolean('GUI', 'AllowUpdateByGui', true)) {
    $appEngine->forwardError(ERROR_INVALID_MODULE);
}
$appEngine->checkUserAuthentication(true, ACL_MOD_UPDATE, ACL_ACTION_SYNCHRONIZE);
$appTR->loadModule("update");
//
// Actions
//
if (check_request_var("update")) {
    $appEngine->handleAction("update");
}
//
// View data
//
ProcessTemplate("settings/update.html.php");
Пример #18
0
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.
 */
include_once "include/config.inc.php";
$appEngine->checkUserAuthentication();
$appTR->loadModule("index");
$appTR->loadModule("roles");
// PHP version.
$phpVersion = phpversion();
// Roles of current user.
$roles = null;
if ($appEngine->isAuthenticationActive()) {
    $u = new \svnadmin\core\entities\User();
    $u->name = $appEngine->getSessionUsername();
    $roles = $appEngine->getAclManager()->getRolesOfUser($u);
    sort($roles);
}
SetValue("PHPVersion", $phpVersion);
SetValue("Roles", $roles);
ProcessTemplate("index.html.php");
Пример #19
0
        if (check_request_var('load')) {
            exit(0);
        }
    }
}
//
// View data
//
$repositoryParentList = array();
$repositoryList = array();
try {
    // Repository parent locations.
    $repositoryParentList = $engine->getRepositoryViewProvider()->getRepositoryParents();
    // Repositories of all locations.
    foreach ($repositoryParentList as $rp) {
        $repositoryList[$rp->identifier] = $engine->getRepositoryViewProvider()->getRepositoriesOfParent($rp);
        usort($repositoryList[$rp->identifier], array('\\svnadmin\\core\\entities\\Repository', 'compare'));
    }
    // Show options column?
    if ($engine->isProviderActive(PROVIDER_REPOSITORY_EDIT) && $engine->hasPermission(ACL_MOD_REPO, ACL_ACTION_DUMP) && $engine->getConfig()->getValueAsBoolean('GUI', 'RepositoryDumpEnabled', false)) {
        SetValue('ShowOptions', true);
        SetValue('ShowDumpOption', true);
    }
} catch (Exception $ex) {
    $engine->addException($ex);
}
SetValue('RepositoryParentList', $repositoryParentList);
SetValue('RepositoryList', $repositoryList);
SetValue('ShowDeleteButton', $engine->getConfig()->getValueAsBoolean('GUI', 'RepositoryDeleteEnabled', true));
ProcessTemplate('repository/repositorylist.html.php');
Пример #20
0
 * along with this program.
 */
include "include/config.inc.php";
//
// Authentication
//
// Authentication disabled.
if (!$appEngine->isAuthenticationActive()) {
    $appEngine->forward(PAGE_HOME, null, true);
}
// If the user is already logged in, we should redirect him to the index page.
if ($appEngine->checkUserAuthentication(false)) {
    $appEngine->forward(PAGE_HOME, null, true);
}
$appTR->loadModule("login");
//
// Actions
//
if (check_request_var("login")) {
    $appEngine->handleAction("login_authentication");
}
//
// HTTP Request Vars
//
$logged_out = check_request_var("loggedout");
//
// View Data
//
SetValue("LoggedOut", $logged_out);
ProcessTemplate("login.html.php");
Пример #21
0
$oGroup->name = $groupname;
// Users of group
$users = null;
$allusers = null;
if ($appEngine->isGroupViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_GROUP, ACL_ACTION_VIEW)) {
    $users = $appEngine->getGroupViewProvider()->getUsersOfGroup($oGroup);
    usort($users, array('\\svnadmin\\core\\entities\\User', "compare"));
    // All users except the already assigned users.
    if ($appEngine->isUserViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_GROUP, ACL_ACTION_ASSIGN)) {
        $allusers = $appEngine->getUserViewProvider()->getUsers(false);
        usort($allusers, array('\\svnadmin\\core\\entities\\User', "compare"));
        $len = count($users);
        for ($i = 0; $i < $len; $i++) {
            if_array_remove_object_element($allusers, $users[$i], "name");
        }
        $allusers = array_values($allusers);
    }
}
// Access-Path permissions of the current group.
$paths = null;
if ($appEngine->isAccessPathViewActive() && $appEngine->checkUserAuthentication(false, ACL_MOD_ACCESSPATH, ACL_ACTION_VIEW)) {
    $paths = $appEngine->getAccessPathViewProvider()->getPathsOfGroup($oGroup);
    usort($paths, array('\\svnadmin\\core\\entities\\AccessPath', "compare"));
}
SetValue("GroupName", $groupname);
SetValue("GroupNameEncoded", rawurlencode($groupname));
SetValue("UserList", $users);
SetValue("AllUserList", $allusers);
SetValue("AccessPathList", $paths);
ProcessTemplate("group/groupview.html.php");
Пример #22
0
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.
 */
include "include/config.inc.php";
//
// Authentication
//
$engine = \svnadmin\core\Engine::getInstance();
if (!$engine->isProviderActive(PROVIDER_REPOSITORY_EDIT)) {
    $engine->forwardInvalidModule(true);
}
$engine->checkUserAuthentication(true, ACL_MOD_REPO, ACL_ACTION_ADD);
$appTR->loadModule("repositorycreate");
//
// Actions
//
if (check_request_var('create')) {
    $engine->handleAction('create_repository');
}
//
// View Data
//
SetValue('RepositoryParentList', $engine->getRepositoryViewProvider()->getRepositoryParents());
ProcessTemplate("repository/repositorycreate.html.php");
Пример #23
0
$ldapUserAttributesEx = $cfgTpl->getValue("Users:ldap", "Attributes");
SetValue("LdapUserBaseDn", $ldapUserBaseDn);
SetValue("LdapUserBaseDnEx", $ldapUserBaseDnEx);
SetValue("LdapUserSearchFilter", $ldapUserSearchFilter);
SetValue("LdapUserSearchFilterEx", $ldapUserSearchFilterEx);
SetValue("LdapUserAttributes", $ldapUserAttributes);
SetValue("LdapUserAttributesEx", $ldapUserAttributesEx);
// LDAP group provider information.
$ldapGroupBaseDn = $cfgEngine->getValue("Groups:ldap", "BaseDN");
$ldapGroupBaseDnEx = $cfgTpl->getValue("Groups:ldap", "BaseDN");
$ldapGroupSearchFilter = $cfgEngine->getValue("Groups:ldap", "SearchFilter");
$ldapGroupSearchFilterEx = $cfgTpl->getValue("Groups:ldap", "SearchFilter");
$ldapGroupAttributes = $cfgEngine->getValue("Groups:ldap", "Attributes");
$ldapGroupAttributesEx = $cfgTpl->getValue("Groups:ldap", "Attributes");
$ldapGroupsToUserAttribute = $cfgEngine->getValue("Groups:ldap", "GroupsToUserAttribute");
$ldapGroupsToUserAttributeEx = $cfgTpl->getValue("Groups:ldap", "GroupsToUserAttribute");
$ldapGroupsToUserAttributeValue = $cfgEngine->getValue("Groups:ldap", "GroupsToUserAttributeValue");
$ldapGroupsToUserAttributeValueEx = $cfgTpl->getValue("Groups:ldap", "GroupsToUserAttributeValue");
SetValue("LdapGroupBaseDn", $ldapGroupBaseDn);
SetValue("LdapGroupBaseDnEx", $ldapGroupBaseDnEx);
SetValue("LdapGroupSearchFilter", $ldapGroupSearchFilter);
SetValue("LdapGroupSearchFilterEx", $ldapGroupSearchFilterEx);
SetValue("LdapGroupAttributes", $ldapGroupAttributes);
SetValue("LdapGroupAttributesEx", $ldapGroupAttributesEx);
SetValue("LdapGroupsToUserAttribute", $ldapGroupsToUserAttribute);
SetValue("LdapGroupsToUserAttributeEx", $ldapGroupsToUserAttributeEx);
SetValue("LdapGroupsToUserAttributeValue", $ldapGroupsToUserAttributeValue);
SetValue("LdapGroupsToUserAttributeValueEx", $ldapGroupsToUserAttributeValueEx);
// Process template.
ProcessTemplate("settings/backend.html.php");
Пример #24
0
<?php

include "include/config.inc.php";
$appEngine->forwardInvalidModule(!$appEngine->isUserEditActive());
$appEngine->checkUserAuthentication(true, ACL_MOD_USER, ACL_ACTION_CHANGEPASS);
$appTR->loadModule("userchangepass");
// Action handling.
// Form request to create the user
$create = check_request_var('changepass');
if ($create) {
    $appEngine->handleAction('change_password');
}
$encUsername = get_request_var("username");
$username = rawurldecode($encUsername);
$sessUser = $appEngine->getSessionUsername();
if ($sessUser != NULL) {
    if ($username == NULL) {
        $username = $sessUser;
    }
    if ($sessUser != $username) {
        $appEngine->checkUserAuthentication(true, ACL_MOD_USER, ACL_ACTION_CHANGEPASS_OTHER);
    }
}
SetValue("Username", $username);
ProcessTemplate("user/userchangepassword.html.php");