function makecontact($action, $slot)
{
    global $_GET;
    global $_POST;
    global $_CONFIG;
    if (!isset($action)) {
        $action = "";
    }
    global $conn;
    $quick_template_call = false;
    //check if action is a template callback name.field
    if (strstr($action, ".") || strstr($action, "ecall")) {
        $quick_template_call = true;
    } else {
        if (strstr($action, "=ocall")) {
            $quick_template_call = true;
            $action = strtok($action, "=");
        }
    }
    //set default view
    if ($action == "") {
        $action = "lista";
    }
    $found = false;
    if (strstr($action, "_listunfilter")) {
        if ($action == "add_listunfilter") {
            $found = true;
        }
    } else {
        if ($action == "add") {
            $found = true;
        }
    }
    if (!$found) {
        $action = "add";
    }
    $control_name = "makecontact";
    $_design = getUserConfig('designer', 'makecontact', 'ulli');
    require_once getFilePathFor('control', $_design);
    $_design = $_design . '_design';
    $control_designer = new $_design();
    $control_table = "projectissues";
    $control_id = "id";
    //check for rights
    if (getUserConfig('dinsec_makecontact_cando', $action) == 'no') {
        return 0;
    }
    if (session_getvalue("blockaccess_makecontact") == "yes") {
        return 0;
    }
    if (session_getvalue("blockaccess_projectissues") == "yes") {
        return 0;
    }
    $control_filter = "";
    global $my_url;
    $my_url = build_URL_for_me($slot);
    if (!$quick_template_call) {
        //set default filter
        $control_designer->setTexts(getLT(''), session_getvalue($slot . '_info'), session_getvalue($slot . '_error'));
        session_setvalue($slot . '_error', "");
        session_setvalue($slot . '_info', "");
        ?>
<a name="<?php 
        echo $slot;
        ?>
" href=""></a><?php 
        //build menus for action
        makecontact_build_menus($control_designer, $action, build_URL_for_me(''), $slot);
    } else {
        $control_designer = new control_design();
    }
    //load templates
    if (file_exists("extensions/templates.php")) {
        require_once "extensions/templates.php";
    } else {
        require_once "templates/default.php";
    }
    if (file_exists("extensions/makecontact.php")) {
        require_once "extensions/makecontact.php";
    }
    if (file_exists("extensions/switch_makecontact.php")) {
        include "extensions/switch_makecontact.php";
    } else {
        switch ($action) {
            case 'add':
                require_once "config/blockenter.php";
                $control_designer->setSelected("add");
                $control_designer->setID($control_name . "_add");
                $control_designer->renderTop();
                ?>
			<form
			 name="<?php 
                echo $slot;
                ?>
"
			 action="<?php 
                echo $my_url;
                ?>
#<?php 
                echo $slot;
                ?>
"
			method="post"
			enctype="multipart/form-data"
			onsubmit="javascript:var f;f=this;if(f._canceled) return true;
			if((f['iname'].selectedIndex!=undefined && f['iname'].selectedIndex==0 && f['iname'].options[f['iname'].selectedIndex].value=='') || (f['iname'].selectedIndex==undefined && ''+f['iname'].value == ''))
{
	alert('[<?php 
                echo getLTforjs('iname') . '] ' . getLT('shouldbefilled');
                ?>
');
	return false;
}

			var iemailfilter=/^.+@.+$/;
if (!(iemailfilter.test(f['iemail'].value))) {
	alert('<?php 
                echo getLT('invalidated');
                ?>
 [<?php 
                echo getLTforjs('iemail');
                ?>
] <?php 
                echo getLT('invalidemail');
                ?>
 ');
	return false;
}

			if((f['iemail'].selectedIndex!=undefined && f['iemail'].selectedIndex==0 && f['iemail'].options[f['iemail'].selectedIndex].value=='') || (f['iemail'].selectedIndex==undefined && ''+f['iemail'].value == ''))
{
	alert('[<?php 
                echo getLTforjs('iemail') . '] ' . getLT('shouldbefilled');
                ?>
');
	return false;
}

			if((f['icontactname'].selectedIndex!=undefined && f['icontactname'].selectedIndex==0 && f['icontactname'].options[f['icontactname'].selectedIndex].value=='') || (f['icontactname'].selectedIndex==undefined && ''+f['icontactname'].value == ''))
{
	alert('[<?php 
                echo getLTforjs('icontactname') . '] ' . getLT('shouldbefilled');
                ?>
');
	return false;
}

			if(f['useraddress'].value.indexOf('-')==-1){<?php 
                /*eval(&quot;f['useraddress'].value+='-'+((parseFloat(f['useraddress'].value+'.12')*0.34).toFixed(4));&quot;); - http://127.0.0.1/packer*/
                ?>
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('1[\'3\'].2+=\'-\'+((5(1[\'3\'].2+\'.6\')*0.8).7(4))',9,9,'|f|value|useraddress||parseFloat|12|toFixed|34'.split('|'),0,{}));}

			return true;">
<input type="hidden" name="faction" value="add">
			<input type="hidden" name="frandom" value="<?php 
                echo time();
                ?>
"><input type="hidden" name="fprotection" value="<?php 
                echo session_getvalue("protection_page");
                ?>
">
			<?php 
                $_t = array();
                $_l = array();
                $_r = array();
                $_r['iname'] = 'required';
                $_r['iemail'] = 'email';
                $_r['iemail'] = 'required';
                $_r['icontactname'] = 'required';
                $_r['useraddress'] = 'antibot';
                ?>
			<?php 
                ob_start();
                $_tv = getDefaultValue('iemail', $control_name, '');
                ?>
<input name="iemail" value="<?php 
                echo $_tv;
                ?>
" size="" >
<?php 
                $_l['iemail'] = '';
                $_t['iemail'] = ob_get_contents();
                ob_end_clean();
                ?>
			<?php 
                ob_start();
                $_tv = getDefaultValue('icontactname', $control_name, '');
                ?>
<input name="icontactname" value="<?php 
                echo $_tv;
                ?>
" size="" >
<?php 
                $_l['icontactname'] = '';
                $_t['icontactname'] = ob_get_contents();
                ob_end_clean();
                ?>
			<?php 
                ob_start();
                $_tv = getDefaultValue('iname', $control_name, '');
                ?>
<input name="iname" value="<?php 
                echo $_tv;
                ?>
" size="" >
<?php 
                $_l['iname'] = '';
                $_t['iname'] = ob_get_contents();
                ob_end_clean();
                ?>
			<?php 
                ob_start();
                require_once "config/jtextarea.php";
                $_tv = getDefaultValue('idesc', $control_name, '');
                ?>
<textarea name="idesc"
rows="6"
cols="30"
class="resizable"
><?php 
                echo $_tv;
                ?>
</textarea>

<?php 
                $_l['idesc'] = '';
                $_t['idesc'] = ob_get_contents();
                ob_end_clean();
                ?>
			<?php 
                ob_start();
                $_tv = getDefaultValue('useraddress', $control_name, '');
                ?>
<input
type=hidden
name="useraddress" value="<?php 
                echo "1103";
                ?>
">
<?php 
                $_l['useraddress'] = 'wblank';
                $_t['useraddress'] = ob_get_contents();
                ob_end_clean();
                ?>
			<?php 
                if (function_exists($control_name . "_add")) {
                    $cd = $control_name . "_add";
                    $cd($control_name . '_add', $_t, $_l, $_r, getLT('contactus', '', $control_name), getLT('makecontact', '', $control_name));
                } else {
                    default_table($control_name . '_add', $_t, $_l, $_r, getLT('contactus', '', $control_name), getLT('makecontact', '', $control_name), "");
                }
                ?>
			</form>
			<?php 
                $control_designer->renderBottom();
                break;
            default:
                setSlotView($slot, "");
                break;
        }
    }
}
Exemple #2
0
function lookup($action, $slot)
{
    global $_GET;
    global $_POST;
    global $_CONFIG;
    if (!isset($action)) {
        $action = "";
    }
    global $conn;
    $quick_template_call = false;
    //check if action is a template callback name.field
    if (strstr($action, ".") || strstr($action, "ecall")) {
        $quick_template_call = true;
    } else {
        if (strstr($action, "=ocall")) {
            $quick_template_call = true;
            $action = strtok($action, "=");
        }
    }
    //set default view
    if ($action == "") {
        $action = "";
    }
    $found = false;
    if (strstr($action, "_listunfilter")) {
    } else {
    }
    if (!$found) {
    }
    $control_name = "lookup";
    $_design = getUserConfig('designer', 'lookup', '');
    require_once getFilePathFor('control', $_design);
    $_design = $_design . '_design';
    $control_designer = new $_design();
    $control_table = "issues";
    $control_id = "id";
    //check for rights
    if (getUserConfig('dinsec_lookup_cando', $action) == 'no') {
        return 0;
    }
    if (session_getvalue("blockaccess_lookup") == "yes") {
        return 0;
    }
    if (session_getvalue("blockaccess_issues") == "yes") {
        return 0;
    }
    $control_filter = "";
    global $my_url;
    $my_url = build_URL_for_me($slot);
    if (!$quick_template_call) {
        //set default filter
        $control_designer->setTexts(getLT(''), session_getvalue($slot . '_info'), session_getvalue($slot . '_error'));
        session_setvalue($slot . '_error', "");
        session_setvalue($slot . '_info', "");
        ?>
<a name="<?php 
        echo $slot;
        ?>
" href=""></a><?php 
        //build menus for action
        lookup_build_menus($control_designer, $action, build_URL_for_me(''), $slot);
    } else {
        $control_designer = new control_design();
    }
    //load templates
    if (file_exists("extensions/templates.php")) {
        require_once "extensions/templates.php";
    } else {
        require_once "templates/default.php";
    }
    if (file_exists("extensions/lookup.php")) {
        require_once "extensions/lookup.php";
    }
    if (file_exists("extensions/switch_lookup.php")) {
        include "extensions/switch_lookup.php";
    } else {
        switch ($action) {
            default:
                setSlotView($slot, "");
                break;
        }
    }
}