Exemple #1
0
include '../../../include/authenticate.php';
if (!checkperm('u')) {
    exit('Permission denied.');
}
include '../../../include/general.php';
if ($_POST) {
    $email_to = getvalescaped('users', NULL);
    $email_to = str_replace(array('\\n', '\\r', '\\t'), ',', $email_to);
    $email_to = explode(',', $email_to);
    $email_to = array_map('trim', $email_to);
    $email_to = array_filter($email_to);
    $email_to = implode(', ', $email_to);
    $email_subject = getvalescaped('email_subject', 'Asset Manager Client Approval Submission');
    $email_message = getvalescaped('email_message', '');
    $settings = array('email_to' => $email_to, 'email_subject' => $email_subject, 'email_message' => $email_message);
    set_plugin_config('approval', $settings);
}
$settings = get_plugin_config('approval');
if (empty($settings)) {
    $settings = array();
}
$settings = $settings + array('email_to' => NULL, 'email_subject' => 'Client Approval Submission', 'email_message' => '');
?>

<?php 
include '../../../include/header.php';
?>

<div class="BasicsBox"> 
	<h2>&nbsp;</h2>
	<h1>Client Approval Settings</h1>
/**
 * Generate the first half of the "guts" of a plugin setup page from a page definition array. This
 * function deals with processing the POST that comes (usually) as a result of clicking on the Save
 * Configuration button.
 *
 * The page definition array is typically constructed by a series of calls to config_add_xxxx
 * functions (see below). See the setup page for the sample plugin for information on how to use
 * this and the associated functions.
 *
 * @param $page_def mixed an array whose elements are generated by calls to config_add_xxxx functions
 *        each of which describes how one of the plugin's configuration variables.
 * @param $plugin_name string the name of the plugin for which the function is being invoked.
 * @return string containing a status message if the post was of an .rsc file.
 */
function config_gen_setup_post($page_def,$plugin_name)
    {
    if (getval('upload','')!='')
        {
        return handle_rsc_upload($plugin_name);
        }
    elseif ((getval('submit','')!='') || (getval('save','')!=''))
        {
        $config=array();
        foreach ($page_def as $def)
            {
            $omit = false;
            switch ($def[0])
                {
                case 'section_header':
                    $omit = true;
                    break;
                case 'text_list':
                    $GLOBALS[$def[1]] = explode(',', getval($def[1], ''));
                    break;
                case 'hidden_param':
                    break;
                default:
                    $GLOBALS[$def[1]] = getval($def[1], is_array($GLOBALS[$def[1]])?array():'');
                    break;
                }
            if (!$omit)
                {
                $config[$def[1]]=$GLOBALS[$def[1]];
                }
            }
        set_plugin_config($plugin_name,$config);
        if (getval('submit','')!=''){redirect('pages/team/team_plugins.php');}
        }
    }
Exemple #3
0
    $ldapauth['newusergroup'] = $_POST['newusergroup'];
    $ldapauth['ldapusercontainer'] = $_POST['ldapusercontainer'];
    $ldapauth['ldaptype'] = $_POST['ldaptype'];
    $ldapauth['rootdn'] = $_POST['rootdn'];
    $ldapauth['rootpass'] = $_POST['rootpass'];
    $ldapauth['addomain'] = $_POST['addomain'];
    $ldapauth['ldapgroupcontainer'] = $_POST['ldapgroupcontainer'];
    if (isset($_POST['ldapGroupName'])) {
        $ldapGroupCount = count($_POST['ldapGroupName']);
        for ($ti = 0; $ti < $ldapGroupCount; $ti++) {
            $grpName = $_POST['ldapGroupName'][$ti];
            $ldapauth['groupmap'][$grpName]['rsGroup'] = $_POST['ldapmaptors'][$grpName];
            $ldapauth['groupmap'][$grpName]['enabled'] = isset($_POST['ldapGroupEnable'][$grpName]);
        }
    }
    set_plugin_config("posixldapauth", $ldapauth);
    redirect("pages/team/team_home.php");
} else {
    $ldapauth = get_plugin_config("posixldapauth");
    if ($ldapauth == null) {
        $ldapauth['enable'] = false;
        $ldapauth['ldapserver'] = 'localhost';
        $ldapauth['port'] = '389';
        $ldapauth['basedn'] = 'dc=mydomain,dc=net';
        $ldapauth['loginfield'] = 'uid';
        $ldapauth['usersuffix'] = '';
        $ldapauth['createusers'] = true;
        $ldapauth['groupbased'] = false;
        $ldapauth['newusergroup'] = '2';
        $ldapauth['ldapusercontainer'] = 'cn=users';
        $ldapauth['ldaptype'] = 0;
/**
 * Generate the first half of the "guts" of a plugin setup page from a page definition array. This
 * function deals with processing the POST that comes (usually) as a result of clicking on the Save
 * Configuration button.
 *
 * The page definition array is typically constructed by a series of calls to config_add_xxxx
 * functions (see below). See the setup page for the sample plugin for information on how to use
 * this and the associated functions.
 * 
 * If wishing to store array of values in one config option, in your setup page have something like the 
 * following which adds a single definition for each key of your config option:
 * foreach($usergroups as $k => $group)
 *   {
 *   global $usergroupemails;
 *   if(!isset($usergroupemails[$group["ref"]])){$usergroupemails[$group["ref"]]=array();} // Define any missing keys
 *   $page_def[] = config_add_text_list_input("usergroupemails[".$group["ref"]."]",$group["name"]); //need to pass a string that looks like: "$configoption["key"]"
 *   }
 * The key can consist of numbers, letters or an underscore contained within "" or ''. If using numbers you don't need the quote marks
 *
 *
 * @param $page_def mixed an array whose elements are generated by calls to config_add_xxxx functions
 *        each of which describes how one of the plugin's configuration variables.
 * @param $plugin_name string the name of the plugin for which the function is being invoked.
 * @return string containing a status message if the post was of an .rsc file.
 */
function config_gen_setup_post($page_def, $plugin_name)
{
    if (getval('upload', '') != '') {
        return handle_rsc_upload($plugin_name);
    } elseif (getval('submit', '') != '' || getval('save', '') != '') {
        $config = array();
        foreach ($page_def as $def) {
            $array_offset = "";
            if (preg_match("/\\[[\"|']?\\w+[\"|']?\\]/", $def[1], $array_offset)) {
                $array = preg_replace("/\\[[\"|']?\\w+[\"|']?\\]/", "", $def[1]);
                preg_match("/[\"|']?\\w+[\"|']?/", $array_offset[0], $array_offset);
            }
            $omit = false;
            if (!empty($array_offset)) {
                $curr_post = getval($array, "");
                if ($curr_post == "") {
                    continue;
                }
                //Ignore if Array already handled or blank
                foreach ($curr_post as $key => $val) {
                    $config[$array][$key] = explode(',', $val);
                    $GLOBALS[$array][$key] = explode(',', $val);
                }
                unset($_POST[$array]);
                //Unset once array has been handled to prevent duplicate changes
                $omit = true;
            } else {
                switch ($def[0]) {
                    case 'html':
                        $omit = true;
                        break;
                    case 'section_header':
                        $omit = true;
                        break;
                    case 'text_list':
                        $GLOBALS[$def[1]] = explode(',', getval($def[1], ''));
                        break;
                    case 'hidden_param':
                        break;
                    default:
                        $GLOBALS[$def[1]] = getval($def[1], is_array($GLOBALS[$def[1]]) ? array() : '');
                        break;
                }
            }
            if (!$omit) {
                $config[$def[1]] = $GLOBALS[$def[1]];
            }
        }
        set_plugin_config($plugin_name, $config);
        if (getval('submit', '') != '') {
            redirect('pages/team/team_plugins.php');
        }
    }
}
}
if (getval("submit", "") != "") {
    $viewInFinder = array();
    if ($useMultiples) {
        $arrRef = 0;
        foreach ($staticSyncDirs as $tDir) {
            $postName = "afpServerPath" . $tDir['syncdir'];
            $viewInFinder['multiafpServerPath'][$tDir['syncdir']] = $_POST[$postName];
            $arrRef++;
        }
    }
    $viewInFinder['afpServerPath'] = $_POST['afpServerPath'];
    $viewInFinder['usePerms'] = $_POST['usePerms'];
    //print_r($_POST);
    //exit;
    set_plugin_config("view_in_finder", $viewInFinder);
} else {
    $viewInFinder = get_plugin_config("view_in_finder");
    if ($viewInFinder == null) {
        $viewInFinder['afpServerPath'] = "afp://example.com/share_name";
        $viewInFinder['usePerms'] = 0;
    }
    if (!array_key_exists('afpServerPath', $viewInFinder)) {
        $viewInFinder['afpServerPath'] = "afp://example.com/share_name";
    }
    if (!array_key_exists("usePerms", $viewInFinder)) {
        $viewInFinder['usePerms'] = 0;
    }
    if (!array_key_exists('multiafpServerPath', $viewInFinder)) {
        $viewInFinder['multiafpServerPath'] = array();
    }
Exemple #6
0
if (count($ldapgroups) > 0){
	sql_query('delete from simpleldap_groupmap where rsgroup is not null');
}

for ($i=0; $i < count($ldapgroups); $i++){
	if ($ldapgroups[$i] <> '' && $rsgroups[$i] <> '' && is_numeric($rsgroups[$i])){
		$query = "replace into simpleldap_groupmap (ldapgroup,rsgroup,priority) values ('" . escape_check($ldapgroups[$i]) . "','" . $rsgroups[$i] . "' ,'" . $priority[$i] ."')";
		sql_query($query);		
	}
} 


	$config['simpleldap'] = $simpleldap;

	set_plugin_config("simpleldap",$config);
	redirect("pages/team/team_plugins.php");
	}



// retrieve list if groups for use in mapping dropdown
$rsgroups = sql_query('select ref, name from usergroup order by name asc');

include "../../../include/header.php";

// if some of the values aren't set yet, fudge them so we don't get an undefined error
// this may be important for updates to the plugin that introduce new variables
foreach (array('ldapserver','domain','port','basedn','loginfield','usersuffix','emailsuffix','fallbackusergroup','email_attribute','phone_attribute','update_group') as $thefield){
	if (!isset($simpleldap[$thefield])){
		$simpleldap[$thefield] = '';