本文整理汇总了PHP中Registry::get_value方法的典型用法代码示例。如果您正苦于以下问题:PHP Registry::get_value方法的具体用法?PHP Registry::get_value怎么用?PHP Registry::get_value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registry
的用法示例。
在下文中一共展示了Registry::get_value方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: used_diskspace
public static function used_diskspace()
{
global $user;
$user_data = new DataUserData($user->get_user_id());
$user_filesize = $user_data->get_filesize();
$user_quota = $user_data->get_quota();
if ($user_quota != 0) {
$diskspace_per = $user_filesize / $user_quota * 100;
if ($diskspace_per == 0) {
$diskspace_per_display = "(0%)";
} else {
$diskspace_per = floor($diskspace_per);
if ($diskspace_per == 0) {
$diskspace_per_display = "(> 1%)";
} else {
$diskspace_per_display = "(" . $diskspace_per . "%)";
}
}
if (round($user_filesize / $user_quota * 100, 0) >= (int) Registry::get_value("data_quota_warning")) {
$quotaWarn = " <img src='images/icons/notice.png' alt='W' />";
} else {
$quotaWarn = "";
}
} else {
$quotaWarn = "";
$diskspace_per_display = "";
}
$act_filesize = Convert::convert_byte_1024($user_filesize);
$template = new HTMLTemplate("data/home/summary/used_diskspace.html");
$template->set_var("used_diskspace", $act_filesize . " " . $diskspace_per_display . "" . $quotaWarn);
return $template->get_string();
}
示例2: output
public static function output($session_expired = false)
{
$auth = new Auth();
$template = new HTMLTemplate("login_header.html");
$template->output();
if (is_numeric($_POST['language_id'])) {
$template = new HTMLTemplate("base/login/login.html", null, $_POST['language_id']);
} else {
$template = new HTMLTemplate("base/login/login.html");
}
if ($_POST[username]) {
$template->set_var("username", $_POST[username]);
} else {
$template->set_var("username", "");
}
if ($_POST[password]) {
$template->set_var("password", $_POST[password]);
} else {
$template->set_var("password", "");
}
if ($session_expired === true) {
$template->set_var("session_expired", "true");
} else {
$template->set_var("session_expired", "false");
}
$language_array = Language::list_languages();
$result = array();
$counter = 0;
if (is_array($language_array)) {
foreach ($language_array as $key => $value) {
$language = new Language($value);
$result[$counter]['option'] = $value;
$result[$counter]['name'] = $language->get_full_name();
if ($_POST['language_id'] == $value) {
$result[$counter]['selected'] = "selected='selected'";
} else {
$result[$counter]['selected'] = "";
}
$counter++;
}
}
$template->set_var("languages", $result);
$template->set_var("product", constant("PRODUCT"));
$template->set_var("product_version", constant("PRODUCT_VERSION"));
$template->set_var("function", Registry::get_value("base_product_function"));
$template->set_var("user", Registry::get_value("base_product_user"));
$template->output();
}
示例3: system_info
public static function system_info()
{
$template = new HTMLTemplate("base/system_info.html");
$template->set_var("product", constant("PRODUCT"));
$template->set_var("product_version", constant("PRODUCT_VERSION"));
$product_user = Registry::get_value("base_product_user");
$product_function = Registry::get_value("base_product_function");
$template->set_var("product_user", $product_user);
$template->set_var("product_function", $product_function);
$paramquery = $_GET;
$paramquery['run'] = "software_info";
$params = http_build_query($paramquery, '', '&');
$template->set_var("sw_info_params", $params);
$paramquery = $_GET;
$paramquery['run'] = "license";
$params = http_build_query($paramquery, '', '&');
$template->set_var("license_params", $params);
$include_array = SystemHandler::list_includes();
if (is_array($include_array) and count($include_array) >= 1) {
$include_string = null;
foreach ($include_array as $key => $value) {
if (!$include_string) {
$include_string = $value['name'];
} else {
$include_string = $include_string . ", " . $value['name'];
}
}
$template->set_var("includes", $include_string);
} else {
$template->set_var("includes", "<span class='italic'>none</span>");
}
$module_array = SystemHandler::list_modules();
if (is_array($module_array) and count($module_array) >= 1) {
$module_string = null;
foreach ($module_array as $key => $value) {
if (!$module_string) {
$module_string = $value['name'];
} else {
$module_string = $module_string . ", " . $value['name'];
}
}
$template->set_var("modules", $module_string);
} else {
$template->set_var("modules", "<span class='italic'>none</span>");
}
$template->output();
}
示例4: run
/**
* @see CronInterface::run()
*/
public static function run()
{
if (self::check() == true) {
$last_run_daily_datetime = Registry::get_value("base_cron_last_run_daily_datetime");
$last_run_weekly_datetime = Registry::get_value("base_cron_last_run_weekly_datetime");
$last_run_daily_datetime_handler = new DatetimeHandler($last_run_daily_datetime);
$last_run_weekly_datetime_handler = new DatetimeHandler($last_run_weekly_datetime);
$current_datetime_handler = new DatetimeHandler(date("Y-m-d H:i:s"));
if ($last_run_daily_datetime_handler->distance($current_datetime_handler) >= 86400) {
$daily = true;
} else {
$daily = false;
}
if ($last_run_weekly_datetime_handler->distance($current_datetime_handler) >= 604800) {
$weekly = true;
} else {
$weekly = false;
}
$cron_event = new CronEvent(self::$last_run_id, $daily, $weekly);
$event_handler = new EventHandler($cron_event);
if ($event_handler->get_success() == true) {
if (self::$last_run_id + 1 > 256) {
Registry::set_value("base_cron_last_run_id", 1);
self::$last_run_id = 1;
} else {
Registry::set_value("base_cron_last_run_id", self::$last_run_id + 1);
self::$last_run_id = self::$last_run_id + 1;
}
Registry::set_value("base_cron_last_run_datetime", date("Y-m-d H:i:s"));
self::$last_run_datetime = date("Y-m-d H:i:s");
if ($daily == true) {
Registry::set_value("base_cron_last_run_daily_datetime", date("Y-m-d H:i:s"));
}
if ($weekly == true) {
Registry::set_value("base_cron_last_run_weekly_datetime", date("Y-m-d H:i:s"));
}
}
}
}
示例5: ip_error_count
/**
* @see SecurityInterface::ip_error_count()
* @return integer
*/
public static function ip_error_count()
{
$ip = $_SERVER['REMOTE_ADDR'];
$lead_time = date("Y-m-d H:i:s", time() - (int) Registry::get_value("base_max_ip_lead_time"));
return SystemLog::count_ip_failed_logins_with_begin($ip, $lead_time);
}
示例6: check_all
/**
* @see SessionInterface::check_all()
* Checks all existing sessions; destroys them, if invalid
*/
public static function check_all()
{
$session_array = Session_Access::list_entries();
if (is_array($session_array) and count($session_array) >= 1) {
foreach ($session_array as $key => $value) {
$session_access = new Session_Access($value);
$session_datetime = explode(" ", $session_access->get_datetime());
$session_date = explode("-", $session_datetime[0]);
$session_full_time = explode("+", $session_datetime[1]);
$session_time = explode(":", $session_full_time[0]);
$session_mktime = mktime($session_time[0], $session_time[1], $session_time[2], $session_date[1], $session_date[2], $session_date[0]);
$current_mktime = time();
$session_timeout = Registry::get_value("base_session_timeout");
$max_session_mktime = $session_mktime + (int) $session_timeout;
if ($current_mktime > $max_session_mktime) {
$session = new Session($value);
$session->destroy();
}
}
}
}
示例7: create
//.........这里部分代码省略.........
if ($this->template_data_array and is_numeric($this->template_data_type_id)) {
$value = Value::get_instance(null);
if ($value->create($folder_id, $owner_id, $this->template_data_type_id, $this->template_data_array) == null) {
$project_folder->delete(true, true);
if ($transaction_id != null) {
$transaction->rollback($transaction_id, false);
}
throw new ProjectCreateMasterDataException("Could not create master-data value");
}
$project_item = new ProjectItem($project_id);
$project_item->set_gid(1);
$project_item->set_status_id(1);
$project_item->set_item_id($value->get_item_id());
if ($project_item->link_item() == false) {
$project_folder->delete(true, true);
if ($transaction_id != null) {
$transaction->rollback($transaction_id, false);
}
throw new ProjectCreateMasterDataException("Could not create master-data item link");
}
if ($project_item->set_required(true) == false) {
$project_folder->delete(true, true);
if ($transaction_id != null) {
$transaction->rollback($transaction_id, false);
}
throw new ProjectCreateMasterDataException("Could not create master-data item role");
}
}
// Permissions
if ($organisation_unit_id) {
$organisation_unit = new OrganisationUnit($organisation_unit_id);
try {
$project_permission = new ProjectPermissionUser(null);
$project_permission->create($owner_id, $project_id, (int) Registry::get_value("project_user_default_permission"), null, 1);
} catch (ProjectPermissionUserException $e) {
$project_folder->delete(true, true);
if ($transaction_id != null) {
$transaction->rollback($transaction_id, false);
}
throw new ProjectCreatePermissionUserException("Could not create user/owner permission");
}
$leader_array = $organisation_unit->list_leaders();
if (is_array($leader_array) and count($leader_array) >= 1) {
foreach ($leader_array as $key => $value) {
try {
$project_permission = new ProjectPermissionUser(null);
$project_permission->create($value, $project_id, (int) Registry::get_value("project_leader_default_permission"), null, 2);
} catch (ProjectPermissionUserException $e) {
$project_folder->delete(true, true);
if ($transaction_id != null) {
$transaction->rollback($transaction_id, false);
}
throw new ProjectCreatePermissionLeaderException("Could not create leader permission");
}
}
}
try {
$project_permission = new ProjectPermissionOrganisationUnit(null);
$project_permission->create($organisation_unit_id, $project_id, (int) Registry::get_value("project_organisation_unit_default_permission"), null, 3);
} catch (ProjectPermissionOrganisationUnitException $e) {
$project_folder->delete(true, true);
if ($transaction_id != null) {
$transaction->rollback($transaction_id, false);
}
throw new ProjectCreatePermissionOrganisationUnitException("Could not create Organisation Unit permission");
}
示例8: start
/**
* @see ServiceInterface::start()
* @return boolean
*/
public function start()
{
if ($this->service and $this->service_id) {
$java_vm = Registry::get_value("base_java_vm");
if ($java_vm) {
$binary_access = new BaseBinary_Access($this->service->get_binary_id());
$file = constant("BIN_DIR") . "/" . $binary_access->get_path() . "/" . $binary_access->get_file();
$cmd = "start /B " . $java_vm . " -jar " . $file . " " . $this->service_id;
if (($handle = popen($cmd, "r")) !== false) {
pclose($handle);
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
示例9: change_organisation_unit_permission
/**
* @see ProjectSecurityInterface::change_organisation_unit_permission()
* @param integer $organisation_unit_id
* @return bool
* @throws ProjectSecurityChangeException
*/
public function change_organisation_unit_permission($organisation_unit_id)
{
global $transaction;
if (is_numeric($organisation_unit_id)) {
$transaction_id = $transaction->begin();
$organisation_unit = new OrganisationUnit($organisation_unit_id);
$project_permission_ou_group_array = ProjectPermission::list_entries_by_project_id_and_intention($this->project_id, 4);
if (is_array($project_permission_ou_group_array) and count($project_permission_ou_group_array) >= 1) {
foreach ($project_permission_ou_group_array as $key => $value) {
try {
$project_permission = ProjectPermission::get_instance($value);
$project_permission->delete() == false;
} catch (ProjectPermissionException $e) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
throw new ProjectSecurityChangeException();
}
}
}
$project_permission_array = ProjectPermission::list_entries_by_project_id_and_intention($this->project_id, 3);
if (count($project_permission_array) > 0 and is_numeric($project_permission_array[0])) {
$project_permission = ProjectPermission::get_instance($project_permission_array[0]);
if (($return_value = $project_permission->set_organisation_unit_id($organisation_unit_id)) == false) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
throw new ProjectSecurityChangeException();
}
} else {
try {
$project_permission = new ProjectPermissionOrganisationUnit(null);
$return_value = $project_permission->create($organisation_unit_id, $this->project_id, (int) Registry::get_value("project_organisation_unit_default_permission"), null, 3);
} catch (ProjectPermissionOrganisationUnitException $e) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
throw new ProjectSecurityChangeException();
}
}
$group_array = $organisation_unit->list_groups();
if (is_array($group_array) and count($group_array) >= 1) {
foreach ($group_array as $key => $value) {
try {
$project_permission = new ProjectPermissionGroup(null);
$project_permission->create($value, $this->project_id, (int) Registry::get_value("project_group_default_permission"), null, 4);
} catch (ProjectPermissionGroupException $e) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
throw new ProjectSecurityChangeException();
}
}
}
if ($transaction_id != null) {
$transaction->commit($transaction_id);
}
return $return_value;
} else {
throw new ProjectSecurityChangeException("Missing Information");
}
}
示例10: get_content
//.........这里部分代码省略.........
if ($sample_location == $value) {
$result[$counter]['selected'] = "selected";
} else {
$result[$counter]['selected'] = "";
}
$counter++;
}
} else {
$result[$counter]['value'] = "0";
$result[$counter]['content'] = "NO LOCATIONS FOUND!";
}
$template->set_var("location", $result);
} else {
$template->set_var("show_location", false);
}
if ($sample_manufacturer) {
$template->set_var("manufacturer", $sample_manufacturer);
} else {
$template->set_var("manufacturer", "");
}
if ($sample_manufacturer_name) {
$template->set_var("manufacturer_name", $sample_manufacturer_name);
} else {
$template->set_var("manufacturer_name", "");
}
if ($sample_expiry) {
$template->set_var("expiry", $sample_expiry);
} else {
$template->set_var("expiry", "");
}
if ($sample_expiry_warning) {
$template->set_var("expiry_warning", $sample_expiry_warning);
} else {
$template->set_var("expiry_warning", (int) Registry::get_value("sample_default_expiry_warning"));
}
if ($sample_description) {
$template->set_var("desc", $sample_description);
} else {
$template->set_var("desc", "");
}
return $template->get_string();
break;
case "4":
$sample_add_role = $session->read_value("SAMPLE_ADD_ROLE");
$sample_add_item_holder_class = $session->read_value("SAMPLE_ADD_ITEM_HOLDER_CLASS");
$sample_add_item_holder_id = $session->read_value("SAMPLE_ADD_ITEM_HOLDER_ID");
$sample_template = $session->read_value("SAMPLE_TEMPLATE");
$sample_template_data_type = $session->read_value("SAMPLE_TEMPLATE_DATA_TYPE");
$sample_template_data_type_id = $session->read_value("SAMPLE_TEMPLATE_DATA_TYPE_ID");
$sample_template_data_array = $session->read_value("SAMPLE_TEMPLATE_DATA_ARRAY");
$sample_template_obj = new SampleTemplate($sample_template);
$required_array = $sample_template_obj->get_required_requirements();
if (is_array($required_array) and count($required_array) >= 1) {
$value_type_id = 0;
$sample_count = 0;
$is_value = false;
$is_sample = false;
foreach ($required_array as $key => $value) {
if ($value['xml_element'] == "item") {
if ($value['type'] == "value") {
$is_value = true;
} elseif ($value['type'] == "parentsample") {
$is_sample = true;
$sample_count++;
}
}
示例11: io
/**
* Main Controller for reqeusts via index.php
* @throws BaseModuleControllerClassNotFoundException
* @throws BaseModuleControllerFileNotFoundException
*/
public static function io()
{
global $session, $user, $transaction;
$template = new HTMLTemplate("index_header.html");
if (!isset($GLOBALS['fatal_error'])) {
$unique_id = uniqid();
$css_directory = constant("WWW_DIR") . "/css";
if (file_exists($css_directory)) {
$css_directory_array = scandir($css_directory);
if (is_array($css_directory_array)) {
$index_css = "";
foreach ($css_directory_array as $key => $value) {
if (strpos(strrev($value), "ssc.") === 0 and strpos(strrev($value), "ssc.gubed") === false and $value != "main.css") {
if (is_file($css_directory . "/" . $value)) {
if (constant("AVOID_CSS_CACHE") == true) {
$index_css .= "<link rel='stylesheet' type='text/css' href='css/" . $value . "?" . $unique_id . "' title='Style' />\n";
} else {
$index_css .= "<link rel='stylesheet' type='text/css' href='css/" . $value . "' title='Style' />\n";
}
}
}
}
}
$template->set_var("INDEX_CSS", $index_css);
}
$index_js = "";
$js_lib_directory = constant("WWW_DIR") . "/js/lib";
if (file_exists($js_lib_directory)) {
$js_lib_directory_array = scandir($js_lib_directory);
if (is_array($js_lib_directory_array)) {
$index_js = "";
foreach ($js_lib_directory_array as $key => $value) {
if (strpos(strrev($value), "sj.") === 0) {
if (is_file($js_lib_directory . "/" . $value)) {
if (constant("AVOID_JS_CACHE") == true) {
$index_js .= "<script type='text/javascript' src='js/lib/" . $value . "?" . $unique_id . "'></script>\n";
} else {
$index_js .= "<script type='text/javascript' src='js/lib/" . $value . "'></script>\n";
}
}
}
}
}
}
$js_modules_directory = constant("WWW_DIR") . "/js/modules";
if (file_exists($js_modules_directory)) {
$js_modules_directory_array = scandir($js_modules_directory);
if (is_array($js_modules_directory_array)) {
foreach ($js_modules_directory_array as $key => $value) {
if (strpos(strrev($value), "sj.") === 0) {
if (is_file($js_modules_directory . "/" . $value)) {
if (constant("AVOID_JS_CACHE") == true) {
$index_js .= "<script type='text/javascript' src='js/modules/" . $value . "?" . $unique_id . "'></script>\n";
} else {
$index_js .= "<script type='text/javascript' src='js/modules/" . $value . "'></script>\n";
}
}
}
}
}
}
if ($index_js) {
$template->set_var("INDEX_JS", $index_js);
} else {
$template->set_var("INDEX_JS", " ");
}
} else {
$template->set_var("INDEX_CSS", "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/base.css\" title=\"Style\" />\n<link rel=\"stylesheet\" type=\"text/css\" href=\"css/login.css\" title=\"Style\" />");
$template->set_var("INDEX_JS", "");
}
if (!isset($GLOBALS['fatal_error'])) {
$template->set_var("INDEX_TITLE", Registry::get_value("base_html_title"));
if (Cron::check() == true) {
$template->set_var("CRON", true);
} else {
$template->set_var("CRON", false);
}
$template->output();
$max_ip_errors = (int) Registry::get_value("base_max_ip_failed_logins");
if (!is_numeric($max_ip_errors) or $max_ip_errors < 3) {
$max_ip_errors = 3;
}
if (Security::ip_error_count() < $max_ip_errors) {
$session_valid_array = $session->is_valid();
if ($session_valid_array[0] === true) {
$template = new HTMLTemplate("main_header.html");
$sub_menu = array();
$module_dialog_array = ModuleDialog::list_dialogs_by_type("base_user_lists");
if (is_array($module_dialog_array) and count($module_dialog_array) >= 1) {
foreach ($module_dialog_array as $key => $value) {
$paramquery['username'] = $_GET['username'];
$paramquery['session_id'] = $_GET['session_id'];
$paramquery['nav'] = "base";
$paramquery['run'] = "base_user_lists";
$paramquery['dialog'] = $value['internal_name'];
//.........这里部分代码省略.........
示例12: listen_events
/**
* @see EventListenerInterface::listen_events()
* @param object $event_object
* @return bool
*/
public static function listen_events($event_object)
{
if ($event_object instanceof UserDeleteEvent) {
if (ProjectPermission_Access::delete_by_user_id($event_object->get_user_id()) == false) {
return false;
}
}
if ($event_object instanceof GroupDeleteEvent) {
if (ProjectPermission_Access::delete_by_group_id($event_object->get_group_id()) == false) {
return false;
}
}
if ($event_object instanceof OrganisationUnitDeleteEvent) {
if (ProjectPermission_Access::delete_by_organisation_unit_id($event_object->get_organisation_unit_id()) == false) {
return false;
}
}
/**
* @todo slow
*/
if ($event_object instanceof OrganisationUnitLeaderCreateEvent) {
$project_array = Project::list_organisation_unit_related_projects($event_object->get_organisation_unit_id(), true);
if (is_array($project_array) and count($project_array) >= 1) {
$project_permission = new ProjectPermissionUser(null);
foreach ($project_array as $key => $value) {
if ($project_permission->create($event_object->get_leader_id(), $value, (int) Registry::get_value("project_leader_default_permission"), null, 2) == null) {
return false;
}
}
}
}
/**
* @todo slow
*/
if ($event_object instanceof OrganisationUnitLeaderDeleteEvent) {
$project_array = Project::list_organisation_unit_related_projects($event_object->get_organisation_unit_id(), true);
if (is_array($project_array) and count($project_array) >= 1) {
foreach ($project_array as $key => $value) {
$permission_array = self::list_entries_by_project_id_and_intention_and_user_id($value, 2, $event_object->get_leader_id());
if (is_array($permission_array) and count($permission_array) >= 1) {
foreach ($permission_array as $permission_key => $permission_value) {
$project_permission = self::get_instance($permission_value);
if ($project_permission->delete() == false) {
return false;
}
}
}
}
}
}
/**
* @todo slow
*/
if ($event_object instanceof OrganisationUnitQualityManagerCreateEvent) {
$project_array = Project::list_organisation_unit_related_projects($event_object->get_organisation_unit_id(), true);
if (is_array($project_array) and count($project_array) >= 1) {
$project_permission = new ProjectPermissionUser(null);
foreach ($project_array as $key => $value) {
if ($project_permission->create($event_object->get_quality_manager_id(), $value, (int) Registry::get_value("project_quality_manager_default_permission"), null, 5) == null) {
return false;
}
}
}
}
/**
* @todo slow
*/
if ($event_object instanceof OrganisationUnitQualityManagerDeleteEvent) {
$project_array = Project::list_organisation_unit_related_projects($event_object->get_organisation_unit_id(), true);
if (is_array($project_array) and count($project_array) >= 1) {
foreach ($project_array as $key => $value) {
$permission_array = self::list_entries_by_project_id_and_intention_and_user_id($value, 5, $event_object->get_quality_manager_id());
if (is_array($permission_array) and count($permission_array) >= 1) {
foreach ($permission_array as $permission_key => $permission_value) {
$project_permission = self::get_instance($permission_value);
if ($project_permission->delete() == false) {
return false;
}
}
}
}
}
}
/**
* @todo slow
*/
if ($event_object instanceof OrganisationUnitGroupCreateEvent) {
$project_array = self::list_system_setted_projects_by_organisation_id($event_object->get_organisation_unit_id());
if (is_array($project_array) and count($project_array) >= 1) {
foreach ($project_array as $key => $value) {
$project_permission = new ProjectPermissionGroup(null);
if ($project_permission->create($event_object->get_group_id(), $value, (int) Registry::get_value("project_group_default_permission"), null, 4) == null) {
return false;
}
}
//.........这里部分代码省略.........
示例13: listen_events
/**
* @see EventListenerInterface::listen_events()
* @param object $event_object
* @return bool
*/
public static function listen_events($event_object)
{
if ($event_object instanceof FileDeleteEvent) {
$file_version_array = FileVersion_Access::list_entries_by_toid($event_object->get_file_id());
if (is_array($file_version_array)) {
foreach ($file_version_array as $key => $value) {
if (self::delete_file_version_entries($value) == false) {
return false;
}
}
}
}
if ($event_object instanceof FileVersionDeleteEvent) {
if (self::delete_file_version_entries($event_object->get_file_version_id()) == false) {
return false;
}
}
if ($event_object instanceof CronEvent) {
if ($event_object->get_daily() == true) {
$max_cached_images = (int) Registry::get_value("data_max_cached_images");
$outdated_files = FileImageCache_Access::get_outdated_files_by_number($max_cached_images);
if (is_array($outdated_files) and count($max_cached_images) >= 1) {
foreach ($outdated_files as $key => $value) {
if (file_exists(constant("BASE_DIR") . "/filesystem/temp/" . $value['file_version_id'] . "-" . $value['width'] . "-" . $value['height'] . ".jpg")) {
if (unlink(constant("BASE_DIR") . "/filesystem/temp/" . $value['file_version_id'] . "-" . $value['width'] . "-" . $value['height'] . ".jpg") == false) {
return false;
}
} elseif (file_exists(constant("BASE_DIR") . "/filesystem/temp/" . $value['file_version_id'] . "-" . $value['width'] . "-" . $value['height'] . ".png")) {
if (unlink(constant("BASE_DIR") . "/filesystem/temp/" . $value['file_version_id'] . "-" . $value['width'] . "-" . $value['height'] . ".png") == false) {
return false;
}
}
$file_image_cache = new FileImageCache_Access($value['id']);
if ($file_image_cache->delete() == false) {
return false;
}
}
}
}
}
return true;
}
示例14: constant
<?php
/**
* @package data
* @version 0.4.0.0
* @author Roman Konertz <konertz@open-lims.org>
* @copyright (c) 2008-2014 by Roman Konertz
* @license GPLv3
*
* This file is part of Open-LIMS
* Available at http://www.open-lims.org
*
* This program is free software;
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
* version 3 of the License.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, see <http://www.gnu.org/licenses/>.
*/
/**
*
*/
$product_user = Registry::get_value("base_product_user");
$product_function = Registry::get_value("base_product_function");
define("LOGIN_FOOTER", "" . constant("PRODUCT") . ", version: " . constant("PRODUCT_VERSION") . ", " . $product_function . ", " . $product_user . " " . "<br />This is free software; It comes with ABSOLUTELY NO WARRANTY." . "<br />by R. Konertz, B. Tunggal, L. Eichinger et al.; 2008-2011");
示例15: create
/**
* @see UserInterface::create()
* @param string $username
* @param string $gener
* @param string $title
* @param string $forename
* @param string $surname
* @param string $mail
* @param bool $can_change_password
* @param bool $must_change_password
* @param bool $disabled
* @return string Generated User Password
* @throws UserCreationFailedException
* @throws UserAlreadyExistException
*/
public function create($username, $gender, $title, $forename, $surname, $mail, $can_change_password, $must_change_password, $disabled)
{
global $transaction;
if ($this->user) {
if ($username and $gender and $forename and $surname and $mail) {
$transaction_id = $transaction->begin();
if (self::exist_username($username) == true) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
throw new UserAlreadyExistException("", 2);
}
$password = self::generate_password();
if (($user_id = $this->user->create($username, md5(sha1($password)))) != null) {
$user_admin_setting = new UserAdminSetting_Access(null);
if ($user_admin_setting->create($user_id) == false) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
throw new UserCreationFailedException("", 1);
}
$user_profile_setting = new UserRegionalSetting_Access(null);
if ($user_profile_setting->create($user_id, 1, Registry::get_value("base_timezone_id"), true, true, "jS M Y", "dd.mm.yyyy", 1, "metric", "din", null, null, "comma", "dot", "T F S") == false) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
throw new UserCreationFailedException("", 1);
}
if ($can_change_password == true) {
$user_admin_setting->set_can_change_password(true);
} else {
$user_admin_setting->set_can_change_password(false);
}
if ($must_change_password == true) {
$user_admin_setting->set_must_change_password(true);
} else {
$user_admin_setting->set_must_change_password(false);
}
if ($disabled == true) {
$user_admin_setting->set_user_locked(true);
} else {
$user_admin_setting->set_user_locked(false);
}
if ($this->user_profile->create($user_id, $gender, $title, $forename, $surname, $mail) == null) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
throw new UserCreationFailedException("", 1);
}
self::__construct($user_id);
$group = new Group(10);
if ($group->create_user_in_group($user_id) == false) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
throw new UserCreationFailedException("", 1);
}
$user_create_event = new UserCreateEvent($user_id);
$event_handler = new EventHandler($user_create_event);
if ($event_handler->get_success() == false) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
throw new UserCreationFailedException("", 1);
} else {
$transaction->commit($transaction_id);
}
return $password;
} else {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
throw new UserCreationFailedException("", 1);
}
} else {
throw new UserCreationFailedException("", 1);
}
} else {
throw new UserCreationFailedException("", 1);
}
}