Refactor contact management functions and remove phpinfo.php
- Updated formatting and structure of functions in edit_contact.inc.php for better readability and consistency. - Added comments to clarify the purpose of certain code sections, especially regarding mandant handling. - Removed the deprecated phpinfo.php file to clean up the codebase.
This commit is contained in:
@@ -38,7 +38,19 @@ function showBasicAuth($realm): void
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
die();
|
||||
}
|
||||
function encryptId($id)
|
||||
{
|
||||
$encryptedId = base64_encode($id . "EC1ibm38FI53cxmSnQUi");
|
||||
return $encryptedId;
|
||||
}
|
||||
|
||||
// Entschlüsselt eine zuvor verschlüsselte ID, um ihre ursprüngliche Form wiederherzustellen.
|
||||
function decryptId($encryptedId)
|
||||
{
|
||||
$decryptedId = base64_decode($encryptedId);
|
||||
$id = str_replace("EC1ibm38FI53cxmSnQUi", "", $decryptedId);
|
||||
return $id;
|
||||
}
|
||||
//mysqli_result analog zu mysql_result
|
||||
function mysqli_result( $res, $row = 0, $col = 0 ) {
|
||||
if ($row >= 0 && @mysqli_num_rows($res) > $row) {
|
||||
@@ -1239,6 +1251,7 @@ function navigation_fullmenu_rek( $site, $language, $navigation, $parent_id, $le
|
||||
if( $nav["code"] == '404' ){
|
||||
$display = " style='display:none;' ";
|
||||
}
|
||||
|
||||
if($nav["code"] == 'home' || $nav["code"] == 'startseite' || $nav["is_home_page"] == 1){
|
||||
$addr = '/';
|
||||
}
|
||||
@@ -1249,6 +1262,9 @@ function navigation_fullmenu_rek( $site, $language, $navigation, $parent_id, $le
|
||||
if($nav['forward_type'] == 4){
|
||||
$link = "";
|
||||
}
|
||||
if( $nav["code"] == 'ticketcenter' and (get_permission_state('all_tickets', $GLOBALS['main_contact']['master_mandant_id'], $GLOBALS['main_contact']['id']) != 1 and get_permission_state('show_tickets', $GLOBALS['main_contact']['master_mandant_id'], $GLOBALS['main_contact']['id']) != 1)){
|
||||
continue;
|
||||
}
|
||||
$if_query = "(content_id IS NOT NULL AND content_type != 'collection') OR content_id IS NULL OR (content_id IS NOT NULL AND main_mandant_id = ".$GLOBALS['main_contact']['current_mandant_id']." AND content_type = 'collection')";
|
||||
// $if_query = "main_collection_mandant_link.main_collection_id IS NOT NULL AND main_mandant_id = ".$GLOBALS['main_contact']['current_mandant_id'];
|
||||
$query2 = "SELECT * FROM main_page_link LEFT JOIN main_collection ON main_collection.main_collection_setup_id = main_page_link.main_collection_setup_id LEFT JOIN intranet_mandant_link ON main_collection.id = intranet_mandant_link.content_id WHERE (".$if_query.") AND main_page_id = ".$nav['forward_page_id']." AND main_collection_list = 1 AND main_collection.id NOT IN (SELECT main_collection_id FROM main_collection_read WHERE main_contact_id = ".$GLOBALS['main_contact']['id'].") AND main_collection.readable = 1";
|
||||
@@ -3143,7 +3159,7 @@ function update_sitepart_changes( $sitepartId, $headerId, $delete = FALSE ) {
|
||||
// }
|
||||
//}
|
||||
|
||||
function input( $name, $inputname, $typ, $value = "on", $maxlength = NULL, $disabled = FALSE, $evaluate = FALSE, $script = "", $idSuffix = '' ) {
|
||||
function input( $name, $inputname, $typ, $value = "on", $maxlength = NULL, $disabled = FALSE, $evaluate = FALSE, $script = "", $idSuffix = '', $required = FALSE ) {
|
||||
if ($evaluate && $value == "") {
|
||||
//$eval_string = "<font color=\"red\">Bitte füllen Sie dieses Feld aus</font>";
|
||||
$typ = $typ . "_error";
|
||||
@@ -3151,6 +3167,8 @@ function input( $name, $inputname, $typ, $value = "on", $maxlength = NULL, $disa
|
||||
//$eval_string = "";
|
||||
}
|
||||
$eval_string = "";
|
||||
$required_text = ($required) ? " required=\"required\"" : "";
|
||||
|
||||
if ($typ != "smalltext_cc_2_error" && $typ != "hidden") {
|
||||
echo "<div class=\"label " . $inputname . "\"><label for=\"" . $inputname . "\" >" . $name . "</label></div>";
|
||||
}
|
||||
@@ -3168,63 +3186,62 @@ function input( $name, $inputname, $typ, $value = "on", $maxlength = NULL, $disa
|
||||
|
||||
switch ($typ) {
|
||||
case "smalltextarea":
|
||||
echo "<div class=\"input " . $inputname . "\"><textarea name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"small\"" . $disabled_text . $maxlength_text . ">" . $value . "</textarea></div>\n";
|
||||
echo "<div class=\"input " . $inputname . "\"><textarea name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"small\"" . $disabled_text . $maxlength_text . $required_text . ">" . $value . "</textarea></div>\n";
|
||||
break;
|
||||
case "textarea":
|
||||
echo "<div class=\"input " . $inputname . "\"><textarea name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"normal\"" . $disabled_text . $maxlength_text . ">" . $value . "</textarea></div>\n";
|
||||
echo "<div class=\"input " . $inputname . "\"><textarea name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"normal\"" . $disabled_text . $maxlength_text . $required_text . ">" . $value . "</textarea></div>\n";
|
||||
break;
|
||||
case "smalltext_cn_1_error":
|
||||
echo "<div class=\"input_2\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"text\"" . $disabled_text . $maxlength_text . " value=\"" . $value . "\" " . $script . " />" . $eval_string . "\n";
|
||||
echo "<div class=\"input_2\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"text\"" . $disabled_text . $maxlength_text . $required_text . " value=\"" . $value . "\" " . $script . " />" . $eval_string . "\n";
|
||||
break;
|
||||
case "smalltext_cn_1":
|
||||
echo "<div class=\"input_2\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"text\"" . $disabled_text . $maxlength_text . " value=\"" . $value . "\" " . $script . " />" . $eval_string . "\n";
|
||||
echo "<div class=\"input_2\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"text\"" . $disabled_text . $maxlength_text . $required_text . " value=\"" . $value . "\" " . $script . " />" . $eval_string . "\n";
|
||||
break;
|
||||
case "smalltext_cn_2_error":
|
||||
echo "<input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"text\"" . $disabled_text . $maxlength_text . " value=\"" . $value . "\" " . $script . " />" . $eval_string . "\n";
|
||||
echo "<input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"text\"" . $disabled_text . $maxlength_text . $required_text . " value=\"" . $value . "\" " . $script . " />" . $eval_string . "\n";
|
||||
break;
|
||||
case "smalltext_cn_2":
|
||||
echo "<input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"text\"" . $disabled_text . $maxlength_text . " value=\"" . $value . "\" " . $script . " />" . $eval_string . "\n";
|
||||
echo "<input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"text\"" . $disabled_text . $maxlength_text . $required_text . " value=\"" . $value . "\" " . $script . " />" . $eval_string . "\n";
|
||||
break;
|
||||
case "file":
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"file\" /></div>\n";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"file\"" . $required_text . " /></div>\n";
|
||||
break;
|
||||
case "checkbox":
|
||||
$checked_text = ($value == "on") ? "checked=\"checked\"" : "";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname.$idSuffix . "\" class=\"checkbox\" type=\"checkbox\"" . $disabled_text . $checked_text . " " . $script . "/>" . $eval_string . "</div>\n";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname.$idSuffix . "\" class=\"checkbox\" type=\"checkbox\"" . $disabled_text . $checked_text . $required_text . " " . $script . "/>" . $eval_string . "</div>\n";
|
||||
break;
|
||||
case "checkbox_shop":
|
||||
$checked_text = ($value == "on") ? "checked=\"checked\"" : "";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"checkbox_shop\" type=\"checkbox\"" . $disabled_text . $checked_text . " " . $script . "/>" . $eval_string . "</div>\n";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"checkbox_shop\" type=\"checkbox\"" . $disabled_text . $checked_text . $required_text . " " . $script . "/>" . $eval_string . "</div>\n";
|
||||
break;
|
||||
case "checkbox_with_formreload":
|
||||
$checked_text = ($value) ? "checked=\"checked\"" : "";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"checkbox\" type=\"checkbox\"" . $disabled_text . $checked_text . " onclick=\"this.form.submit();\"/>" . $eval_string . "</div>\n";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"checkbox\" type=\"checkbox\"" . $disabled_text . $checked_text . $required_text . " onclick=\"this.form.submit();\"/>" . $eval_string . "</div>\n";
|
||||
break;
|
||||
case "checkbox_with_formreload_checked":
|
||||
$checked_text = ($value) ? "checked=\"checked\"" : "";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"checkbox\" type=\"checkbox\"" . $disabled_text . $checked_text . " onclick=\"this.form.submit();\"/></div>\n";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"checkbox\" type=\"checkbox\"" . $disabled_text . $checked_text . $required_text . " onclick=\"this.form.submit();\"/></div>\n";
|
||||
break;
|
||||
case "password":
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"code\" type=\"password\"" . $disabled_text . $maxlength_text . " value=\"" . $value . "\" /></div>\n";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"code\" type=\"password\"" . $disabled_text . $maxlength_text . $required_text . " value=\"" . $value . "\" /></div>\n";
|
||||
break;
|
||||
case "date":
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"date\" type=\"date\"" . $script . $disabled_text . $maxlength_text . " value=\"" . $value . "\" /></div> \n";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"date\" type=\"date\"" . $script . $disabled_text . $maxlength_text . $required_text . " value=\"" . $value . "\" /></div> \n";
|
||||
break;
|
||||
case "input_pref_delivery_date":
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"code\" type=\"text\"" . $disabled_text . $maxlength_text . " value=\"" . $value . "\" " . $script . " readonly /></div> \n";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"code\" type=\"text\"" . $disabled_text . $maxlength_text . $required_text . " value=\"" . $value . "\" " . $script . " readonly /></div> \n";
|
||||
break;
|
||||
//case "input_pref_delivery_date": echo "<div class=\"input\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"code\" type=\"text\"" . $disabled_text . $maxlength_text . " value=\"" . $value . "\" /><img src=\"/layout/frontend/haendler/img/calendar_icon.png\" width=\"15\" height=\"16\" onclick='fPopCalendar(\"date\")' /></div> \n"; break;
|
||||
case "hidden":
|
||||
echo "<input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"hidden\"" . $disabled_text . $maxlength_text . " value=\"" . $value . "\" " . $script . " />\n";
|
||||
break;
|
||||
case "number":
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"number\"" . $disabled_text . $maxlength_text . " value=\"" . $value . "\" " . $script . " min=\"0\" />" . $eval_string . "</div>\n";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"number\"" . $disabled_text . $maxlength_text . $required_text . " value=\"" . $value . "\" " . $script . " min=\"0\" />" . $eval_string . "</div>\n";
|
||||
break;
|
||||
case "color":
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"color\"" . $disabled_text . $maxlength_text . " value=\"" . $value . "\" " . $script . " min=\"0\" />" . $eval_string . "</div>\n";
|
||||
break;
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"color\"" . $disabled_text . $maxlength_text . $required_text . " value=\"" . $value . "\" " . $script . " min=\"0\" />" . $eval_string . "</div>\n";
|
||||
break;
|
||||
default:
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"text\"" . $disabled_text . $maxlength_text . " value=\"" . $value . "\" " . $script . " />" . $eval_string . "</div>\n";
|
||||
echo "<div class=\"input " . $inputname . "\"><input name=\"" . $inputname . "\" id=\"" . $inputname . "\" class=\"" . $typ . "\" type=\"text\"" . $disabled_text . $maxlength_text . $required_text . " value=\"" . $value . "\" " . $script . " />" . $eval_string . "</div>\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user