Advertisement
Guest User

unzend.com_ioncube_decoder36

a guest
Mar 20th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 25.03 KB | None | 0 0
  1. <?php
  2.  
  3. ioncube decoder https://www.unzend.com
  4. define("ADMINAREA", true);
  5. require("../init.php");
  6. $aInt = new WHMCS\Admin("Configure Administrators", false);
  7. $aInt->title = $aInt->lang("administrators", "title");
  8. $aInt->sidebar = "config";
  9. $aInt->icon = "admins";
  10. $aInt->helplink = "Administrators";
  11. $aInt->requireAuthConfirmation();
  12. $validate = new WHMCS\Validate();
  13. $file = new WHMCS\File\Directory($whmcs->get_admin_folder_name() . DIRECTORY_SEPARATOR . "templates");
  14. $adminTemplates = $file->getSubdirectories();
  15. $adminRolesResult = WHMCS\Database\Capsule::table("tbladminroles")->get(array( "id", "name" ));
  16. $adminRoles = array(  );
  17. foreach( $adminRolesResult as $adminRoleResult )
  18. {
  19.     $adminRoles[$adminRoleResult->id] = $adminRoleResult->name;
  20. }
  21. if( $action == "save" )
  22. {
  23.     check_token("WHMCS.admin.default");
  24.     if( defined("DEMO_MODE") )
  25.     {
  26.         redir("demo=1");
  27.     }
  28.  
  29.     $id = (int) App::getFromRequest("id");
  30.     $email = App::getFromRequest("email");
  31.     $username = App::getFromRequest("username");
  32.     $userProvidedPassword = $whmcs->get_req_var("password");
  33.     $email = trim($email);
  34.     $username = trim($username);
  35.     $userProvidedPassword = trim($userProvidedPassword);
  36.     $validate->validate("required", "firstname", array( "administrators", "namerequired" ));
  37.     if( $validate->validate("required", "email", array( "administrators", "emailerror" )) && $validate->validate("email", "email", array( "administrators", "emailinvalid" )) && WHMCS\Database\Capsule::table("tblticketdepartments")->where("email", "=", $email)->count() )
  38.     {
  39.         $validate->addError(array( "administrators", "emailCannotBeSupport" ));
  40.     }
  41.  
  42.     try
  43.     {
  44.         (new WHMCS\User\Admin())->validateUsername($username, $id);
  45.     }
  46.     catch( WHMCS\Exception\Validation\InvalidLength $e )
  47.     {
  48.         $validate->addError(array( "administrators", "usernameLength" ));
  49.     }
  50.     catch( WHMCS\Exception\Validation\InvalidFirstCharacter $e )
  51.     {
  52.         $validate->addError(array( "administrators", "usernameFirstCharacterLetterRequired" ));
  53.     }
  54.     catch( WHMCS\Exception\Validation\InvalidCharacters $e )
  55.     {
  56.         $validate->addError(array( "administrators", "usernameCharacters" ));
  57.     }
  58.     catch( WHMCS\Exception\Validation\DuplicateValue $e )
  59.     {
  60.         $validate->addError(array( "administrators", "userexists" ));
  61.     }
  62.     if( !$id && $validate->validate("required", "password", array( "administrators", "pwerror" )) )
  63.     {
  64.         $validate->validate("match_value", "password", array( "administrators", "pwmatcherror" ), "password2");
  65.     }
  66.  
  67.     if( $validate->hasErrors() )
  68.     {
  69.         $action = "manage";
  70.     }
  71.     else
  72.     {
  73.         if( empty($deptids) )
  74.         {
  75.             $deptids = array(  );
  76.         }
  77.  
  78.         if( empty($ticketnotify) )
  79.         {
  80.             $ticketnotify = array(  );
  81.         }
  82.  
  83.         $supportdepts = implode(",", $deptids);
  84.         $ticketnotify = implode(",", $ticketnotify);
  85.         $disabled = ($disabled == "on" ? 1 : 0);
  86.         if( !in_array($template, $adminTemplates) )
  87.         {
  88.             $template = $adminTemplates[0];
  89.         }
  90.  
  91.         $language = WHMCS\Language\AdminLanguage::getValidLanguageName($language);
  92.         $adminDetails = array( "roleid" => $roleid, "username" => $username, "firstname" => $firstname, "lastname" => $lastname, "email" => $email, "signature" => $signature, "disabled" => $disabled, "notes" => $notes, "template" => $template, "language" => $language, "supportdepts" => $supportdepts, "ticketnotifications" => $ticketnotify );
  93.         if( $id )
  94.         {
  95.             $changes = array(  );
  96.             $admin = WHMCS\User\Admin::find($id);
  97.             if( $admin->roleId != $adminDetails["roleid"] )
  98.             {
  99.                 $changes[] = "Role changed from '" . $adminRoles[$admin->roleId] . "'" . " to '" . $adminRoles[$adminDetails["roleid"]] . "'";
  100.             }
  101.  
  102.             if( $admin->username != $adminDetails["username"] )
  103.             {
  104.                 $changes[] = "Username changed from '" . $admin->username . "' to '" . $adminDetails["username"] . "'";
  105.             }
  106.  
  107.             if( $admin->firstName != $adminDetails["firstname"] )
  108.             {
  109.                 $changes[] = "First Name changed from '" . $admin->firstName . "' to '" . $adminDetails["firstname"] . "'";
  110.             }
  111.  
  112.             if( $admin->lastName != $adminDetails["lastname"] )
  113.             {
  114.                 $changes[] = "Last Name changed from '" . $admin->lastName . "' to '" . $adminDetails["lastname"] . "'";
  115.             }
  116.  
  117.             if( $admin->email != $adminDetails["email"] )
  118.             {
  119.                 $changes[] = "Email changed from '" . $admin->email . "' to '" . $adminDetails["email"] . "'";
  120.             }
  121.  
  122.             if( $admin->disabled != $adminDetails["disabled"] )
  123.             {
  124.                 if( $admin->disabled )
  125.                 {
  126.                     $changes[] = "Admin User Enabled";
  127.                 }
  128.                 else
  129.                 {
  130.                     $changes[] = "Admin User Disabled";
  131.                 }
  132.  
  133.             }
  134.  
  135.             if( $admin->signature != $adminDetails["signature"] )
  136.             {
  137.                 $changes[] = "Signature changed";
  138.             }
  139.  
  140.             if( $admin->notes != $adminDetails["notes"] )
  141.             {
  142.                 $changes[] = "Notes changed";
  143.             }
  144.  
  145.             if( $admin->template != $adminDetails["template"] )
  146.             {
  147.                 $changes[] = "Template changed from '" . $admin->template . "' to '" . $adminDetails["template"] . "'";
  148.             }
  149.  
  150.             if( $admin->language != $adminDetails["language"] )
  151.             {
  152.                 $changes[] = "Language changed from '" . $admin->language . "' to '" . $adminDetails["language"] . "'";
  153.             }
  154.  
  155.             $ticketDepartmentResults = WHMCS\Database\Capsule::table("tblticketdepartments")->get(array( "id", "name" ));
  156.             $ticketDepartments = array(  );
  157.             foreach( $ticketDepartmentResults as $ticketDepartmentResult )
  158.             {
  159.                 $ticketDepartments[$ticketDepartmentResult->id] = $ticketDepartmentResult->name;
  160.             }
  161.             $newSupportDepartments = explode(",", $adminDetails["supportdepts"]);
  162.             if( $admin->supportDepartmentIds != $newSupportDepartments )
  163.             {
  164.                 $added = $removed = array(  );
  165.                 foreach( $newSupportDepartments as $newSupportDepartment )
  166.                 {
  167.                     if( !in_array($newSupportDepartment, $admin->supportDepartmentIds) )
  168.                     {
  169.                         $added[] = $ticketDepartments[$newSupportDepartment];
  170.                     }
  171.  
  172.                 }
  173.                 foreach( $admin->supportDepartmentIds as $existingSupportDepartment )
  174.                 {
  175.                     if( !in_array($existingSupportDepartment, $newSupportDepartments) )
  176.                     {
  177.                         $removed[] = $ticketDepartments[$existingSupportDepartment];
  178.                     }
  179.  
  180.                 }
  181.                 if( array_filter($added) )
  182.                 {
  183.                     $changes[] = "Added Support Departments: " . implode(", ", $added);
  184.                 }
  185.  
  186.                 if( array_filter($removed) )
  187.                 {
  188.                     $changes[] = "Removed Support Departments: " . implode(", ", $removed);
  189.                 }
  190.  
  191.             }
  192.  
  193.             $newNotificationDepartments = explode(",", $adminDetails["ticketnotifications"]);
  194.             if( $admin->receivesTicketNotifications != $newNotificationDepartments )
  195.             {
  196.                 $added = $removed = array(  );
  197.                 foreach( $newNotificationDepartments as $newNotificationDepartment )
  198.                 {
  199.                     if( !in_array($newNotificationDepartment, $admin->receivesTicketNotifications) )
  200.                     {
  201.                         $added[] = $ticketDepartments[$newNotificationDepartment];
  202.                     }
  203.  
  204.                 }
  205.                 foreach( $admin->receivesTicketNotifications as $existingNotificationDepartment )
  206.                 {
  207.                     if( !in_array($existingNotificationDepartment, $newNotificationDepartments) )
  208.                     {
  209.                         $removed[] = $ticketDepartments[$existingNotificationDepartment];
  210.                     }
  211.  
  212.                 }
  213.                 if( array_filter($added) )
  214.                 {
  215.                     $changes[] = "Added Support Departments Notification: " . implode(", ", $added);
  216.                 }
  217.  
  218.                 if( array_filter($removed) )
  219.                 {
  220.                     $changes[] = "Removed Support Departments Notification: " . implode(", ", $removed);
  221.                 }
  222.  
  223.             }
  224.  
  225.             $adminToUpdate = new WHMCS\Auth();
  226.             $adminToUpdate->getInfobyID($id, NULL, false);
  227.             if( $adminToUpdate->getAdminID() && $userProvidedPassword && ($userProvidedPassword = trim($userProvidedPassword)) )
  228.             {
  229.                 if( $adminToUpdate->generateNewPasswordHashAndStore($userProvidedPassword) )
  230.                 {
  231.                     $adminToUpdate->generateNewPasswordHashAndStoreForApi(md5($userProvidedPassword));
  232.                     if( $id == WHMCS\Session::get("adminid") )
  233.                     {
  234.                         $adminToUpdate->setSessionVars();
  235.                     }
  236.  
  237.                     $adminDetails["password_reset_key"] = "";
  238.                     $adminDetails["password_reset_data"] = "";
  239.                     $adminDetails["password_reset_expiry"] = "0000-00-00 00:00:00";
  240.                     $changes[] = "Password Changed";
  241.                 }
  242.                 else
  243.                 {
  244.                     logActivity(sprintf("Failed to update password hash for admin %s.", $adminDetails["username"]));
  245.                 }
  246.  
  247.             }
  248.  
  249.             $adminDetails["updated_at"] = WHMCS\Carbon::now()->toDateTimeString();
  250.             $adminDetails["password_reset_key"] = "";
  251.             $adminDetails["password_reset_data"] = "";
  252.             $adminDetails["password_reset_expiry"] = "0000-00-00 00:00:00";
  253.             update_query("tbladmins", $adminDetails, array( "id" => $id ));
  254.             if( $changes )
  255.             {
  256.                 logAdminActivity("Admin User '" . $adminDetails["username"] . "' modified. Changes: " . implode(". ", $changes));
  257.             }
  258.  
  259.             redir("saved=true");
  260.         }
  261.         else
  262.         {
  263.             $adminDetails["password"] = phpseclib\Crypt\Random::string(21);
  264.             $adminDetails["password_reset_data"] = "";
  265.             $adminDetails["password_reset_key"] = $adminDetails["password_reset_data"];
  266.             $adminDetails["password_reset_expiry"] = "0000-00-00 00:00:00";
  267.             $adminDetails["updated_at"] = WHMCS\Carbon::now()->toDateTimeString();
  268.             $adminDetails["created_at"] = $adminDetails["updated_at"];
  269.             insert_query("tbladmins", $adminDetails);
  270.             $newAdmin = new WHMCS\Auth();
  271.             $newAdmin->getInfobyUsername($adminDetails["username"], NULL, false);
  272.             $userProvidedPassword = trim($userProvidedPassword);
  273.             if( $newAdmin->getAdminID() && $userProvidedPassword && $newAdmin->generateNewPasswordHashAndStore($userProvidedPassword) )
  274.             {
  275.                 $newAdmin->generateNewPasswordHashAndStoreForApi(md5($userProvidedPassword));
  276.             }
  277.             else
  278.             {
  279.                 logActivity(sprintf("Failed to assign password hash for new admin %s." . " Account will stay locked until properly reset.", $adminDetails["username"]));
  280.             }
  281.  
  282.             WHMCS\Admin::dismissFeatureHighlightsUntilUpdateForAdmin($newAdmin->getAdminID());
  283.             logAdminActivity("Admin User '" . $adminDetails["username"] . "' with role " . $adminRoles[$adminDetails["roleid"]] . " created");
  284.             redir("added=true");
  285.         }
  286.  
  287.         exit();
  288.     }
  289.  
  290. }
  291.  
  292. if( $action == "delete" )
  293. {
  294.     check_token("WHMCS.admin.default");
  295.     if( defined("DEMO_MODE") )
  296.     {
  297.         redir("demo=1");
  298.     }
  299.  
  300.     $id = (int) $whmcs->get_req_var("id");
  301.     $adminName = WHMCS\User\Admin::find($id)->username;
  302.     delete_query("tbladmins", array( "id" => $id ));
  303.     logAdminActivity("Admin User '" . $adminName . "' deleted");
  304.     redir("deleted=true");
  305. }
  306.  
  307. ob_start();
  308. if( $action == "" )
  309. {
  310.     $infobox = "";
  311.     if( defined("DEMO_MODE") )
  312.     {
  313.         infoBox("Demo Mode", "Actions on this page are unavailable while in demo mode. Changes will not be saved.");
  314.     }
  315.  
  316.     if( $saved )
  317.     {
  318.         infoBox($aInt->lang("administrators", "changesuccess"), $aInt->lang("administrators", "changesuccessinfo"));
  319.     }
  320.     else
  321.     {
  322.         if( $added )
  323.         {
  324.             infoBox($aInt->lang("administrators", "addsuccess"), $aInt->lang("administrators", "addsuccessinfo"));
  325.         }
  326.         else
  327.         {
  328.             if( $deleted )
  329.             {
  330.                 infoBox($aInt->lang("administrators", "deletesuccess"), $aInt->lang("administrators", "deletesuccessinfo"));
  331.             }
  332.  
  333.         }
  334.  
  335.     }
  336.  
  337.     echo $infobox;
  338.     $data = get_query_vals("tbladmins", "COUNT(id),id", array( "roleid" => "1" ));
  339.     $numrows = $data[0];
  340.     $onlyadminid = ($numrows == "1" ? $data["id"] : 0);
  341.     $jscode = "function doDelete(id) {\n    if(id != " . $onlyadminid . "){\n        if (confirm(\"" . $aInt->lang("administrators", "deletesure", 1) . "\")) {\n        window.location='" . $_SERVER["PHP_SELF"] . "?action=delete&id='+id+'" . generate_token("link") . "';\n        }\n    } else alert(\"" . $aInt->lang("administrators", "deleteonlyadmin", 1) . "\");\n    }";
  342.     echo "<p>";
  343.     echo $aInt->lang("administrators", "description");
  344.     echo "</p>\n\n<p><a href=\"configadmins.php?action=manage\" class=\"btn btn-default\"><i class=\"fas fa-user-plus\"></i> ";
  345.     echo $aInt->lang("administrators", "addnew");
  346.     echo "</a></p>\n\n";
  347.     echo "<h2>" . $aInt->lang("administrators", "active") . " </h2>";
  348.     $aInt->sortableTableInit("nopagination");
  349.     $result = select_query("tbladmins", "", array( "disabled" => "0" ), "firstname` ASC,`lastname", "ASC");
  350.     while( $data = mysql_fetch_array($result) )
  351.     {
  352.         $departments = $deptnames = array(  );
  353.         $supportdepts = db_build_in_array(explode(",", $data["supportdepts"]));
  354.         if( $supportdepts )
  355.         {
  356.             $resultdeptids = select_query("tblticketdepartments", "name", "id IN (" . $supportdepts . ")");
  357.             while( $data_resultdeptids = mysql_fetch_array($resultdeptids) )
  358.             {
  359.                 $deptnames[] = $data_resultdeptids[0];
  360.             }
  361.         }
  362.  
  363.         if( !count($deptnames) )
  364.         {
  365.             $deptnames[] = $aInt->lang("global", "none");
  366.         }
  367.  
  368.         $tabledata[] = array( $data["firstname"] . " " . $data["lastname"], "<a href=\"mailto:" . $data["email"] . "\">" . $data["email"] . "</a>", $data["username"], $adminRoles[$data["roleid"]], implode(", ", $deptnames), "<a href=\"?action=manage&id=" . $data["id"] . "\"><img src=\"images/edit.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Edit\"></a>", "<a href=\"#\" onClick=\"doDelete('" . $data["id"] . "')\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Delete\"></a>" );
  369.     }
  370.     echo $aInt->sortableTable(array( $aInt->lang("fields", "name"), $aInt->lang("fields", "email"), $aInt->lang("fields", "username"), $aInt->lang("administrators", "adminrole"), $aInt->lang("administrators", "assigneddepts"), "", "" ), $tabledata);
  371.     echo "<h2>" . $aInt->lang("administrators", "inactive") . " </h2>";
  372.     $tabledata = array(  );
  373.     $result = select_query("tbladmins", "", array( "disabled" => "1" ), "firstname` ASC,`lastname", "ASC");
  374.     $spacesInUsernames = false;
  375.     while( $data = mysql_fetch_array($result) )
  376.     {
  377.         $departments = $deptnames = array(  );
  378.         $supportdepts = db_build_in_array(explode(",", $data["supportdepts"]));
  379.         if( $supportdepts )
  380.         {
  381.             $resultdeptids = select_query("tblticketdepartments", "name", "id IN (" . $supportdepts . ")");
  382.             while( $data_resultdeptids = mysql_fetch_array($resultdeptids) )
  383.             {
  384.                 $deptnames[] = $data_resultdeptids[0];
  385.             }
  386.         }
  387.  
  388.         if( !count($deptnames) )
  389.         {
  390.             $deptnames[] = $aInt->lang("global", "none");
  391.         }
  392.  
  393.         if( !$spacesInUsernames && strpos($data["username"], " ") !== false )
  394.         {
  395.             $spacesInUsernames = true;
  396.         }
  397.  
  398.         $tabledata[] = array( $data["firstname"] . " " . $data["lastname"], "<a href=\"mailto:" . $data["email"] . "\">" . $data["email"] . "</a>", $data["username"], $adminRoles[$data["roleid"]], implode(", ", $deptnames), "<a href=\"?action=manage&id=" . $data["id"] . "\"><img src=\"images/edit.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Edit\"></a>", "<a href=\"#\" onClick=\"doDelete('" . $data["id"] . "')\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Delete\"></a>" );
  399.     }
  400.     WHMCS\Config\Setting::setValue("AdminUserNamesWithSpaces", $spacesInUsernames);
  401.     echo $aInt->sortableTable(array( $aInt->lang("fields", "name"), $aInt->lang("fields", "email"), $aInt->lang("fields", "username"), $aInt->lang("administrators", "adminrole"), $aInt->lang("administrators", "assigneddepts"), "", "" ), $tabledata);
  402. }
  403. else
  404. {
  405.     if( $action == "manage" )
  406.     {
  407.         if( $id )
  408.         {
  409.             $result = select_query("tbladmins", "", array( "id" => $id ));
  410.             $data = mysql_fetch_array($result);
  411.             $supportdepts = $data["supportdepts"];
  412.             $ticketnotifications = $data["ticketnotifications"];
  413.             $supportdepts = explode(",", $supportdepts);
  414.             $ticketnotify = explode(",", $ticketnotifications);
  415.             if( !$validate->hasErrors() )
  416.             {
  417.                 $roleid = $data["roleid"];
  418.                 $firstname = $data["firstname"];
  419.                 $lastname = $data["lastname"];
  420.                 $email = $data["email"];
  421.                 $username = $data["username"];
  422.                 $signature = $data["signature"];
  423.                 $notes = $data["notes"];
  424.                 $template = $data["template"];
  425.                 $language = $data["language"];
  426.                 $disabled = $data["disabled"];
  427.             }
  428.  
  429.             $numrows = get_query_vals("tbladmins", "COUNT(id)", array( "roleid" => "1" ));
  430.             $onlyadmin = ($numrows == "1" && $roleid == "1" ? true : false);
  431.             $managetitle = $aInt->lang("administrators", "editadmin");
  432.         }
  433.         else
  434.         {
  435.             $supportdepts = $ticketnotify = array(  );
  436.             $managetitle = $aInt->lang("administrators", "addadmin");
  437.         }
  438.  
  439.         $language = WHMCS\Language\AdminLanguage::getValidLanguageName($language);
  440.         $infobox = "";
  441.         if( defined("DEMO_MODE") )
  442.         {
  443.             infoBox("Demo Mode", "Actions on this page are unavailable while in demo mode. Changes will not be saved.");
  444.         }
  445.  
  446.         echo $infobox;
  447.         echo "<p><b>" . $managetitle . "</b></p>";
  448.         if( $validate->hasErrors() )
  449.         {
  450.             infoBox($aInt->lang("global", "validationerror"), $validate->getHTMLErrorOutput(), "error");
  451.             echo $infobox;
  452.         }
  453.  
  454.         echo "\n<form method=\"post\" action=\"";
  455.         echo $whmcs->getPhpSelf();
  456.         echo "?action=save&id=";
  457.         echo $id;
  458.         echo "\">\n\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n<tr><td width=\"20%\" class=\"fieldlabel\">";
  459.         echo $aInt->lang("administrators", "role");
  460.         echo "</td><td class=\"fieldarea\"><select name=\"roleid\" class=\"form-control select-inline\"";
  461.         if( $onlyadmin )
  462.         {
  463.             echo " disabled";
  464.         }
  465.  
  466.         echo ">";
  467.         foreach( $adminRoles as $adminRoleId => $adminRoleName )
  468.         {
  469.             echo "<option value=\"" . $adminRoleId . "\"";
  470.             if( $roleid == $adminRoleId )
  471.             {
  472.                 echo " selected";
  473.             }
  474.  
  475.             echo ">" . $adminRoleName . "</option>";
  476.         }
  477.         echo "</select></td></tr>\n<tr><td class=\"fieldlabel\">";
  478.         echo $aInt->lang("fields", "firstname");
  479.         echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"firstname\" value=\"";
  480.         echo $firstname;
  481.         echo "\" class=\"form-control input-300\"></td></tr>\n<tr><td class=\"fieldlabel\">";
  482.         echo $aInt->lang("fields", "lastname");
  483.         echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"lastname\" value=\"";
  484.         echo $lastname;
  485.         echo "\" class=\"form-control input-300\"></td></tr>\n<tr><td class=\"fieldlabel\">";
  486.         echo $aInt->lang("fields", "email");
  487.         echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"email\" value=\"";
  488.         echo $email;
  489.         echo "\" class=\"form-control input-400\"></td></tr>\n<tr><td class=\"fieldlabel\">";
  490.         echo $aInt->lang("fields", "username");
  491.         echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"username\" autocomplete=\"off\" value=\"";
  492.         echo $username;
  493.         echo "\" class=\"form-control input-250\"></td></tr>\n<tr><td class=\"fieldlabel\">";
  494.         echo $aInt->lang("fields", "password");
  495.         echo "</td><td class=\"fieldarea\"><input type=\"password\" name=\"password\" autocomplete=\"off\" class=\"form-control input-250\">";
  496.         if( $id )
  497.         {
  498.             echo " (" . $aInt->lang("administrators", "entertochange") . ")";
  499.         }
  500.  
  501.         echo "</td></tr>\n<tr><td class=\"fieldlabel\">";
  502.         echo $aInt->lang("fields", "confpassword");
  503.         echo "</td><td class=\"fieldarea\"><input type=\"password\" name=\"password2\" autocomplete=\"off\" class=\"form-control input-250\"></td></tr>\n<tr><td class=\"fieldlabel\">";
  504.         echo $aInt->lang("administrators", "assigneddepts");
  505.         echo "</td><td class=\"fieldarea\">\n<div class=\"row\">\n";
  506.         $nodepartments = true;
  507.         $result = select_query("tblticketdepartments", "", "", "order", "ASC");
  508.         while( $data = mysql_fetch_array($result) )
  509.         {
  510.             $deptid = $data["id"];
  511.             $deptname = $data["name"];
  512.             echo "<div class=\"col-md-6\"><label class=\"checkbox-inline\"><input type=\"checkbox\" name=\"deptids[]\" value=\"" . $deptid . "\"";
  513.             if( in_array($deptid, $supportdepts) )
  514.             {
  515.                 echo " checked";
  516.             }
  517.  
  518.             echo "> " . $deptname . "</label> <label class=\"checkbox-inline\"><input type=\"checkbox\" name=\"ticketnotify[]\" value=\"" . $deptid . "\"";
  519.             if( in_array($deptid, $ticketnotify) )
  520.             {
  521.                 echo " checked";
  522.             }
  523.  
  524.             echo "> Enable Ticket Notifications</label></div>";
  525.             $nodepartments = false;
  526.         }
  527.         if( $nodepartments )
  528.         {
  529.             echo "<div class=\"col-xs-12\">" . $aInt->lang("administrators", "nosupportdepts") . "</div>";
  530.         }
  531.  
  532.         echo "</div>\n</td></tr>\n<tr><td class=\"fieldlabel\">";
  533.         echo $aInt->lang("administrators", "supportsig");
  534.         echo "</td><td class=\"fieldarea\"><textarea name=\"signature\" class=\"form-control\" rows=\"4\">";
  535.         echo $signature;
  536.         echo "</textarea></td></tr>\n<tr><td class=\"fieldlabel\">";
  537.         echo $aInt->lang("administrators", "privatenotes");
  538.         echo "</td><td class=\"fieldarea\"><textarea name=\"notes\" class=\"form-control\" rows=\"4\">";
  539.         echo $notes;
  540.         echo "</textarea></td></tr>\n<tr><td class=\"fieldlabel\">";
  541.         echo $aInt->lang("fields", "template");
  542.         echo "</td><td class=\"fieldarea\"><select name=\"template\" class=\"form-control select-inline\">";
  543.         foreach( $adminTemplates as $temp )
  544.         {
  545.             echo "<option value=\"" . $temp . "\"";
  546.             if( $temp == $template )
  547.             {
  548.                 echo " selected";
  549.             }
  550.  
  551.             echo ">" . ucfirst($temp) . "</option>";
  552.         }
  553.         echo "</select></td></tr>\n<tr><td class=\"fieldlabel\">";
  554.         echo $aInt->lang("global", "language");
  555.         echo "</td><td class=\"fieldarea\"><select name=\"language\" class=\"form-control select-inline\">";
  556.         foreach( WHMCS\Language\AdminLanguage::getLanguages() as $lang )
  557.         {
  558.             echo "<option value=\"" . $lang . "\"";
  559.             if( $lang == $language )
  560.             {
  561.                 echo " selected=\"selected\"";
  562.             }
  563.  
  564.             echo ">" . ucfirst($lang) . "</option>";
  565.         }
  566.         echo "</select></td></tr>\n<tr><td class=\"fieldlabel\">";
  567.         echo $aInt->lang("fields", "disable");
  568.         echo "</td><td class=\"fieldarea\"><label class=\"checkbox-inline\"><input type=\"checkbox\" name=\"disabled\"";
  569.         if( $disabled == 1 )
  570.         {
  571.             echo " checked";
  572.         }
  573.  
  574.         if( $onlyadmin || $id == $_SESSION["adminid"] )
  575.         {
  576.             echo " disabled";
  577.         }
  578.  
  579.         echo " /> ";
  580.         echo $aInt->lang("administrators", "disableinfo");
  581.         echo "</label></td></tr>\n</table>\n\n<div class=\"btn-container\">\n    <input type=\"submit\" value=\"";
  582.         echo $aInt->lang("global", "savechanges");
  583.         echo "\" class=\"btn btn-primary\">\n    <input type=\"button\" value=\"";
  584.         echo $aInt->lang("global", "cancelchanges");
  585.         echo "\" class=\"btn btn-default\" onclick=\"window.location='configadmins.php'\" />\n</div>\n\n</form>\n\n";
  586.     }
  587.  
  588. }
  589.  
  590. $content = ob_get_contents();
  591. ob_end_clean();
  592. $aInt->content = $content;
  593. $aInt->jscode = $jscode;
  594. $aInt->display();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement