$json = new stdClass(); $json->type = empty($msgOk) ? "error" : "success"; $json->message = empty($msgOk) ? $msgErr : $msgOk; $php_error = error_get_last(); if ($php_error !== null) { $json->php_error = $php_error; } print json_encode($json); exit(0); } //////////////////////////////////////////////////////////////////////////////// // Set administrator. //////////////////////////////////////////////////////////////////////////////// if (check_request_var("setadmin") || $show_setadmin) { // Assign the Administrator role. if (check_request_var("saveadmin")) { $selusers = get_request_var("selected_users"); $oU = new \svnadmin\core\entities\User(); $oU->name = $selusers[0]; $oR = new \svnadmin\core\entities\Role(); $oR->name = "Administrator"; // Set selected user as Administrator. try { $b = $appEngine->getAclManager()->assignUserToRole($oU, $oR); if (!$b) { throw new Exception("ERROR: Can not assign user to role."); } $b = $appEngine->getAclManager()->save(); if (!$b) { throw new Exception("ERROR: Can not save ACL changes."); }
* along with this program. */ include "include/config.inc.php"; if (!$appEngine->isGroupViewActive() && !$appEngine->isAccessPathViewActive()) { $appEngine->forwardInvalidModule(true); } $appEngine->checkUserAuthentication(true, ACL_MOD_GROUP, ACL_ACTION_VIEW); $appTR->loadModule("groupview"); // Action handling. if (check_request_var('unassign')) { $appEngine->handleAction('unassign_fromgroup'); } if (check_request_var('unassign_permission')) { $appEngine->handleAction('unassign_permission'); } if (check_request_var('assign_usergroup') || check_request_var('assign_subgroupgroup')) { $appTR->loadModule("groupassign"); $appEngine->handleAction("assign_togroup"); } // Get required variables. $groupname = get_request_var('groupname'); // Current selected group. $oGroup = new \svnadmin\core\entities\Group(); $oGroup->id = $groupname; $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); $groups = $appEngine->getGroupViewProvider()->getSubgroupsOfGroup($oGroup);
* along with this program. */ include "include/config.inc.php"; if (!$appEngine->isGroupViewActive() && !$appEngine->isAccessPathViewActive()) { $appEngine->forwardInvalidModule(true); } $appEngine->checkUserAuthentication(true, ACL_MOD_GROUP, ACL_ACTION_VIEW); $appTR->loadModule("groupview"); // Action handling. if (check_request_var('unassign')) { $appEngine->handleAction('unassign_usergroup'); } if (check_request_var('unassign_permission')) { $appEngine->handleAction('unassign_permission'); } if (check_request_var('assign_usergroup')) { $appEngine->handleAction("assign_usertogroup"); } // Get required variables. $groupname = get_request_var('groupname'); // Current selected group. $oGroup = new \svnadmin\core\entities\Group(); $oGroup->id = $groupname; $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.
// // Authentication // if (!$appEngine->isProviderActive(PROVIDER_ACCESSPATH_VIEW)) { $appEngine->forwardError(ERROR_INVALID_MODULE); } $appEngine->checkUserAuthentication(true, ACL_MOD_ACCESSPATH, ACL_ACTION_VIEW); $appTR->loadModule("accesspathslist"); // // Actions // // Form 'delete' request. if (check_request_var("delete")) { $appEngine->handleAction("delete_accesspath"); } else { if (check_request_var("assign_projectmanager")) { $appEngine->handleAction("assign_projectmanager"); } } // // View Data // $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 (!$engine->isProviderActive(PROVIDER_REPOSITORY_VIEW)) { $engine->forwardError(ERROR_INVALID_MODULE); } $engine->checkUserAuthentication(true, ACL_MOD_REPO, ACL_ACTION_VIEW); $appTR->loadModule("repositorylist"); // // Actions // if (check_request_var("delete")) { $engine->handleAction("delete_repository"); } else { if (check_request_var('dump')) { $engine->handleAction('dump_repository'); exit(0); } else { 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);
* 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"; if (!$appEngine->isUserViewActive() || !$appEngine->isGroupViewActive() || !$appEngine->isGroupEditActive()) { $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.
* 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. */ 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");
* You should have received a copy of the GNU General Public License * 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");
* 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"; // // 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");
* 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->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);
// Authentication // $engine = \svnadmin\core\Engine::getInstance(); if (!$engine->isProviderActive(PROVIDER_REPOSITORY_EDIT)) { $engine->forwardError(ERROR_INVALID_MODULE); } // Disabled by config? if (!$engine->getConfig()->getValueAsBoolean('GUI', 'RepositoryDeleteEnabled', true)) { $engine->forwardError(ERROR_INVALID_MODULE); } // // HTTP Request Vars // $varParentIdentifierEnc = get_request_var('pi'); $selrepos = get_request_var("selected_repos"); $remove_accesspaths = check_request_var('delete_ap'); $varParentIdentifier = rawurldecode($varParentIdentifierEnc); // // Validation // if ($selrepos == NULL || $varParentIdentifier === NULL) { $engine->addException(new ValidationException(tr("You have to select at least one repository."))); } else { try { // Iterate all selected items. $c = count($selrepos); for ($i = 0; $i < $c; $i++) { $oR = new \svnadmin\core\entities\Repository($selrepos[$i], $varParentIdentifier); $b = $appEngine->getRepositoryEditProvider()->delete($oR); if (!$b) { throw new Exception(tr("Could not delete repository %0", array($oR->name)));
<?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->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");
* 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->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");
* 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->isAccessPathViewActive()); $appEngine->checkUserAuthentication(true, ACL_MOD_ACCESSPATH, ACL_ACTION_VIEW); $appTR->loadModule("accesspathview"); // Action handling. if (check_request_var("unassign")) { $appEngine->handleAction("unassign_permission"); } elseif (check_request_var("assign_permission")) { $appEngine->handleAction("assign_usergrouptoaccesspath"); } // 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();
function get_request_var($varname) { $method = null; if (check_request_var($varname, $method)) { switch ($method) { case 'get': if (is_array($_GET[$varname])) { if (count($_GET[$varname]) == 1 && empty($_GET[$varname][0])) { return null; } } return $_GET[$varname]; case 'post': if (is_array($_POST[$varname])) { if (count($_POST[$varname]) == 1 && empty($_POST[$varname][0])) { return null; } } return $_POST[$varname]; } } return null; }
<?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");