Example #1
0
 */
require_once '../../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $gfwww . 'scm/include/scm_utils.php';
require_once $gfcommon . 'scm/SCMFactory.class.php';
global $sys_use_scm;
$group_id = getIntFromRequest('group_id');
// Check permissions
session_require(array('group' => $group_id, 'admin_flags' => 'A'));
scm_header(array('title' => _('SCM Repository'), 'group' => $group_id));
if (getStringFromRequest('submit')) {
    $hook_params = array();
    $hook_params['group_id'] = $group_id;
    $scmradio = '';
    $scmvars = array_keys(_getRequestArray());
    foreach (_getRequestArray() as $key => $value) {
        foreach ($scm_list as $scm) {
            if ($key == strstr($key, $scm . "_")) {
                $hook_params[$key] = $value;
            } elseif ($key == 'scmradio') {
                $scmradio = $value;
            }
        }
    }
    $SCMFactory = new SCMFactory();
    $scm_plugins = $SCMFactory->getSCMs();
    if (in_array($scmradio, $scm_plugins)) {
        $group =& group_get_object($group_id);
        foreach ($scm_plugins as $plugin) {
            $myPlugin = plugin_get_object($plugin);
            if ($scmradio == $myPlugin->name) {
Example #2
0
/**
 * getArrayFromRequest - get an array from REQUEST
 * @param	string $key	Key of the wanted value
 * @param	string $defaultValue	if we can't find the wanted value, it returns the default value
 * @return	array	The value
 */
function getArrayFromRequest($key, $defaultValue = array())
{
    return _getArrayFromArray(_getRequestArray(), $key, $defaultValue);
}