function check_requirements() { // verify that the service exists if ($this->obj_service->verify_id()) { $this->obj_service->load_data(); // verify the rate is valid if ($this->obj_service->data["id_rate_table"]) { $this->obj_cdr_rate_table->id = $this->obj_service->data["id_rate_table"]; if (!$this->obj_cdr_rate_table->verify_id()) { log_write("error", "page_output", "The requested CDR rate table is invalid, there may be some problems with the information in the database."); return 0; } } else { log_write("error", "page_output", "You have yet to set a CDR Rate Table for this service to use - please do so using the plan page before attempting to override the rates"); return 0; } } else { log_write("error", "page_output", "The requested service (" . $this->obj_service->id . ") does not exist - possibly the service has been deleted."); return 0; } unset($sql_obj); // verify that this is a phone service if ($this->service_type != ("phone_single" || "phone_tollfree" || "phone_trunk")) { log_write("error", "page_output", "The requested service is not a phone service."); return 0; } return 1; }
function check_requirements() { // verify that customer exists if (!$this->obj_customer->verify_id()) { log_write("error", "page_output", "The requested customer (" . $this->obj_customer->id . ") does not exist - possibly the customer has been deleted."); return 0; } // verify that the service-customer entry exists if ($this->obj_customer->id_service_customer) { if (!$this->obj_customer->verify_id_service_customer()) { log_write("error", "page_output", "The requested service (" . $this->obj_customer->id_service_customer . ") was not found and/or does not match the selected customer"); return 0; } } // verify that this is a phone trunk service if ($this->obj_customer->obj_service->data["typeid_string"] != "phone_trunk") { log_write("error", "page_output", "The requested service is not a phone_trunk service."); return 0; } // verify that the DDI value is correct (if one has been supplied) if ($this->obj_ddi->id) { if (!$this->obj_ddi->verify_id()) { log_write("error", "page_output", "The supplied DDI ID is not valid"); return 0; } } return 1; }
function check_requirements() { // verify that customer exists if (!$this->obj_customer->verify_id()) { log_write("error", "page_output", "The requested customer (" . $this->obj_customer->id . ") does not exist - possibly the customer has been deleted."); return 0; } // verify that the service-customer entry exists if ($this->ob_customer->id_service_customer) { if (!$this->obj_customer->verify_id_service_customer()) { log_write("error", "page_output", "The requested service (" . $this->obj_customer->id_service_customer . ") was not found and/or does not match the selected customer"); return 0; } } // verify the options IDs if (!$this->obj_cdr_rate_table->verify_id_override()) { log_write("error", "page_output", "The requested service does not have a valid CDR rate table"); } // check if the option override rate id is valid (if supplied) if (!$this->obj_cdr_rate_table->verify_id_rate_override()) { $this->obj_cdr_rate_table->id_rate_override = 0; } // verify that this is a phone service if ($this->obj_customer->obj_service->data["typeid_string"] != ("phone_single" || "phone_trunk" || "phone_tollfree")) { log_write("error", "page_output", "The requested service is not a phone service."); return 0; } return 1; }
function check_requirements() { // verify that user exists $sql_obj = new sql_query(); $sql_obj->string = "SELECT id FROM users WHERE id='" . $this->id . "' LIMIT 1"; $sql_obj->execute(); if (!$sql_obj->num_rows()) { log_write("error", "page_output", "The requested user (" . $this->id . ") does not exist - possibly the user has been deleted."); return 0; } unset($sql_obj); // verify that the specified staff member exists $sql_obj = new sql_query(); $sql_obj->string = "SELECT id, name_staff FROM staff WHERE id='" . $this->staffid . "' LIMIT 1"; $sql_obj->execute(); if (!$sql_obj->num_rows()) { log_write("error", "page_output", "The requested employee (" . $this->staffid . ") does not exist - possibly the employeee has been deleted."); return 0; } else { $sql_obj->fetch_array(); $this->name_staff = $sql_obj->data[0]["name_staff"]; } unset($sql_obj); return 1; }
function check_requirements() { // verify that project exists $sql_obj = new sql_query(); $sql_obj->string = "SELECT id FROM projects WHERE id='" . $this->id . "' LIMIT 1"; $sql_obj->execute(); if (!$sql_obj->num_rows()) { log_write("error", "page_output", "The requested project (" . $this->id . ") does not exist - possibly the project has been deleted."); return 0; } unset($sql_obj); // verify that phase exists and belongs to this project if ($this->phaseid) { $sql_obj = new sql_query(); $sql_obj->string = "SELECT projectid FROM project_phases WHERE id='" . $this->phaseid . "' LIMIT 1"; $sql_obj->execute(); if (!$sql_obj->num_rows()) { log_write("error", "page_output", "The requested phase (" . $this->phaseid . ") does not exist - possibly the phase has been deleted."); return 0; } else { $sql_obj->fetch_array(); if ($sql_obj->data[0]["projectid"] != $this->id) { log_write("error", "page_output", "The requested phase (" . $this->phaseid . ") does not belong to the selected project (" . $this->id . ")"); return 0; } } unset($sql_obj); } return 1; }
function check_requirements() { // verify that the invoice exists $sql_obj = new sql_query(); $sql_obj->string = "SELECT id FROM account_ar WHERE id='" . $this->id . "' LIMIT 1"; $sql_obj->execute(); if (!$sql_obj->num_rows()) { log_write("error", "page_output", "The requested invoice (" . $this->id . ") does not exist - possibly the invoice has been deleted."); return 0; } unset($sql_obj); // verify that the item id supplied exists and fetch required information if ($this->itemid) { $sql_obj = new sql_query(); $sql_obj->string = "SELECT id, type FROM account_items WHERE id='" . $this->itemid . "' AND invoiceid='" . $this->id . "' LIMIT 1"; $sql_obj->execute(); if (!$sql_obj->num_rows()) { log_write("error", "page_output", "The requested payment/invoice combination does not exist. Are you trying to use a link to a deleted payment?"); return 0; } else { $sql_obj->fetch_array(); $this->item_type = $sql_obj->data[0]["type"]; } } return 1; }
function check_requirements() { // verify that customer exists if (!$this->obj_customer->verify_id()) { log_write("error", "page_output", "The requested customer (" . $this->obj_customer->id . ") does not exist - possibly the customer has been deleted."); return 0; } // verify that the service-customer entry exists if ($this->obj_customer->id_service_customer) { if (!$this->obj_customer->verify_id_service_customer()) { log_write("error", "page_output", "The requested service (" . $this->obj_customer->id_service_customer . ") was not found and/or does not match the selected customer"); return 0; } } // verify that this is a data_traffic service if ($this->obj_customer->obj_service->data["typeid_string"] != "data_traffic") { log_write("error", "page_output", "The requested service is not a data_traffic service."); return 0; } // verify that the selected IPv4 address is valid (if provided) if ($this->obj_ipv4->id) { if (!$this->obj_ipv4->verify_id()) { log_write("error", "page_output", "The supplied IPv4 address is not valid"); return 0; } } return 1; }
function lockfile_remove() { // delete lock file if (!unlink($GLOBALS["config"]["lock_file"])) { log_write("error", "script", "Unable to remove lock file " . $GLOBALS["config"]["lock_file"] . ""); } }
function check_requirements() { // verify that the service exists $sql_obj = new sql_query(); $sql_obj->string = "SELECT id, id_rate_table FROM services WHERE id='" . $this->id . "' LIMIT 1"; $sql_obj->execute(); if ($sql_obj->num_rows()) { $sql_obj->fetch_array(); // verify the rate is valid if ($sql_obj->data[0]["id_rate_table"]) { $this->obj_cdr_rate_table->id = $sql_obj->data[0]["id_rate_table"]; if (!$this->obj_cdr_rate_table->verify_id()) { log_write("error", "page_output", "The requested CDR rate table is invalid, there may be some problems with the information in the database."); return 0; } } else { log_write("error", "page_output", "You have yet to set a CDR Rate Table for this service to use - please do so using the plan page before attempting to override the rates"); return 0; } } else { log_write("error", "page_output", "The requested service (" . $this->id . ") does not exist - possibly the service has been deleted."); return 0; } unset($sql_obj); // verify that this is a phone service if ($this->service_type != ("phone_single" || "phone_trunk" || "phone_tollfree")) { log_write("error", "page_output", "The requested service is not a phone service."); return 0; } return 1; }
function connect($params = array()) { if (!isset($this->status)) { $obj = new smtp($params); if ($obj->connect()) { $obj->status = SMTP_STATUS_CONNECTED; } return $obj; } else { if (!empty($GLOBALS['_CFG']['smtp_ssl'])) { $this->host = "ssl://" . $this->host; } $this->connection = @fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout); if ($this->connection === false) { $this->errors[] = 'Access is denied.'; return false; } @socket_set_timeout($this->connection, 0, 250000); $greeting = $this->get_data(); if (is_resource($this->connection)) { $this->status = 2; return $this->auth ? $this->ehlo() : $this->helo(); } else { log_write($errstr, __FILE__, __LINE__); $this->errors[] = 'Failed to connect to server: ' . $errstr; return false; } } }
function check_requirements() { if (!$this->obj_rate_table->verify_id()) { log_write("error", "page_output", "The supplied rate table ID " . $this->obj_rate_table->id . " does not exist"); return 0; } return 1; }
function check_requirements() { // make sure the domain is valid if (!$this->obj_domain->verify_id()) { log_write("error", "page_output", "The requested domain (" . $this->obj_domain->id . ") does not exist - possibly it has been deleted?"); return 0; } return 1; }
function check_requirements() { // customer must be a reseller if ($this->obj_customer->verify_reseller() != 1) { log_write("error", "page", "This customer is not a reseller."); return 0; } return 1; }
function uni_exit() { global $h5u_debug, $upload_log; if ($h5u_debug) { upldLog('exit uniload'); log_write($upload_log, H5U_LOG); } exit; }
function check_requirements() { // make sure the server is valid if (!$this->obj_name_server_group->verify_id()) { log_write("error", "page_output", "The requested server group (" . $this->obj_name_server_group->id . ") does not exist - possibly the server group has been deleted?"); return 0; } return 1; }
function check_requirements() { // verify that customer exists if (!$this->obj_customer->verify_id()) { log_write("error", "page_output", "The requested customer (" . $this->obj_customer->id . ") does not exist - possibly the customer has been deleted."); return 0; } return 1; }
function check_permissions() { if (user_online()) { log_write("error", "You are already logged in, there is no need to revisit the login page."); return 0; } else { return 1; } }
function check_requirements() { // verify that service group exists if (!$this->obj_service_group->verify_id()) { log_write("error", "page_output", "The requested service group (" . $this->id . ") does not exist - possibly the service group has been deleted."); return 0; } unset($sql_obj); return 1; }
function tac() { global $debug; if ($debug) { global $gl_depth, $gl_time, $gl_count, $gl_names; $name = $gl_names[$gl_depth]; log_write(getmicrotime() - $gl_time[$gl_depth], $gl_names[$gl_depth], $gl_count[$name], $gl_depth); $gl_depth--; } }
function check_requirements() { // make sure logging is enabled if (!$GLOBALS["config"]["FEATURE_LOGS_ENABLE"]) { log_write("error", "page_output", "Application API logging is currently disabled. Adjust FEATURE_LOGS_ENABLE to enable."); return 0; } // otherwise logging is OK :-) return 1; }
function check_requirements() { // verify that the service exists and is a bundle if (!$this->obj_bundle->verify_is_bundle()) { log_write("error", "page_output", "The requested service (" . $this->id . ") does not exist or is not a bundle service"); return 0; } unset($sql_obj); return 1; }
function check_permissions() { // only allow namedadmins group members to have access if (user_permissions_get("namedadmins")) { return 1; } else { log_write("error", "page_output", "You do not have permissions to access this interface, request your administrator to assign you to the namedadmins group"); return 0; } }
function check_requirements() { if (!$this->obj_traffic_type->verify_id()) { log_write("error", "page_output", "The supplied traffic type ID " . $this->obj_traffic_type->id . " does not exist"); return 0; } // check if the page is locked or not $this->locked = $this->obj_traffic_type->check_delete_lock(); return 1; }
function check_requirements() { if (!user_online()) { return 0; } if ($GLOBALS["config"]["AUTH_METHOD"] != "sql") { log_write("error", "page", "User options can only be configured when using local user authentication"); return 0; } return 1; }
function check_requirements() { // verify that vendor exists if (!$this->obj_vendor->verify_id()) { log_write("error", "check_requirements", "The requested vendor - " . $this->id . " - does not exist"); return 0; } // get lock status for deletion $this->locked = $this->obj_vendor->check_delete_lock(); return 1; }
function db_exception_log($message, $sql = "") { $exception = 'Unhandled Exception. <br />'; $exception .= $message; $exception .= "<br /> You can find the error back in the log."; if (!empty($sql)) { $message .= "\r\nRaw SQL : " . $sql; } log_write($message); return $exception; }
function check_permissions() { if (!user_permissions_get("admin")) { return 0; } if ($GLOBALS["config"]["AUTH_METHOD"] != "sql") { log_write("error", "page", "User options can only be configured when using local user authentication"); return 0; } return 1; }
function check_requirements() { // verify that product group exists if (!$this->obj_product_group->verify_id()) { log_write("error", "page_output", "The requested product group (" . $this->id . ") does not exist - possibly the product group has already been deleted?"); return 0; } unset($sql_obj); // check if the product group can be deleted $this->locked = $this->obj_product_group->check_delete_lock(); return 1; }
function check_requirements() { // verify that the account exists if (!$this->obj_chart->verify_id()) { log_write("error", "page_output", "The requested account (" . $this->id . ") does not exist - possibly the account has been deleted."); return 0; } unset($sql_obj); // check the lock status of the account $this->locked = $this->obj_chart->check_delete_lock(); return 1; }
function check_requirements() { // verify that the tax exists $this->obj_sql_tax = new sql_query(); $this->obj_sql_tax->string = "SELECT chartid, CONCAT_WS(' -- ',account_charts.code_chart,account_charts.description) as name_chart FROM account_taxes LEFT JOIN account_charts ON account_charts.id = account_taxes.chartid WHERE account_taxes.id='" . $this->id . "' LIMIT 1"; $this->obj_sql_tax->execute(); if (!$this->obj_sql_tax->num_rows()) { log_write("error", "page_output", "The requested tax (" . $this->id . ") does not exist - possibly the tax has been deleted."); return 0; } return 1; }