This makes the PATH_SELF constant for c_standard_path public.
Add new user session handling class.
Add a generic user-specific version of the c_standard_path and have most user path classes extend it.
Populate a basic version of the content menu for user paths.
User paths should accept user ids, handle the arguments.
The print, pdf, and ps paths are also in the url arguments as well as in a separate class path (I need to review the possibilities and pick only 1 method).
Just about all of the user paths, in their current form, are stubs and need to be implemented.
*
* This is normally done automatically, but in certain cases, this may need to be explicitly called.
*
- * Calling this will trigger default settings to be regernated, including the breadcrumbs.
+ * Calling this will trigger default settings to be regenerated, including the breadcrumbs.
*
* @param c_base_http &$http
* The entire HTTP information to allow for the execution to access anything that is necessary.
*
* @see: self::do_execute()
*/
- protected function set_parameters(&$http, &$database, &$session, $settings) {
+ public function set_parameters(&$http, &$database, &$session, $settings) {
if (!($http instanceof c_base_http)) {
$error = c_base_error::s_log(NULL, array('arguments' => array(':{argument_name}' => 'http', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::INVALID_ARGUMENT);
return c_base_return_error::s_false($error);
* This is used primarily for generating HTML5 pages.
*/
class c_standard_path extends c_base_path {
+ public const PATH_SELF = '';
+
protected const CSS_AS_SECTION = 'as-section';
protected const CSS_AS_SECTION_HEADERS = 'as-section-headers';
protected const CSS_AS_WRAPPER = 'as-wrapper';
protected const CSS_PATH_PART = 'path-part-';
protected const CSS_PATH_FULL = 'path-full-';
- protected const PATH_SELF = '';
-
protected const PATH_MENU_HEADER = 'common/standard/menus/';
protected const PATH_MENU_UTILITY = 'common/standard/menus/';
protected const PATH_MENU_BREADCRUMBS = 'common/standard/menus/';
/**
* Implements set_parameters().
*/
- protected function set_parameters(&$http, &$database, &$session, $settings) {
+ public function set_parameters(&$http, &$database, &$session, $settings) {
$result = parent::set_parameters($http, $database, $session, $settings);
if (c_base_return::s_has_error($result)) {
return $result;
* A number representing which block of text to return.
* @param array $arguments
* (optional) An array of arguments to convert into text.
+ *
+ * @return string
+ * A string is returned as the custom text.
*/
protected function pr_get_text($code, $arguments = array()) {
return '';
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides the standard path handling class with user-path specific parts.
+ */
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+require_once('common/base/classes/base_path.php');
+require_once('common/base/classes/base_database.php');
+
+require_once('common/standard/classes/standard_path.php');
+
+require_once('common/theme/classes/theme_html.php');
+
+/**
+ * Provides user-specific extensions to standard paths.
+ */
+class c_standard_path_user extends c_standard_path {
+ protected const ID_USER_MINIMUM = 1000;
+
+ protected const CLASS_ID_USER = 'id-user';
+ protected const CLASS_ID_USER_EXTERNAL = 'id-user-external';
+
+ /**
+ * Implements pr_get_text_title().
+ */
+ protected function pr_get_text_title($arguments = array()) {
+ return $this->pr_get_text(0, $arguments);
+ }
+}
const URI_USER_PRINT = 'u/print';
const URI_USER_PS = 'u/ps';
const URI_USER_REFRESH = 'u/refresh';
+ const URI_USER_SESSION = 'u/session';
const URI_USER_SETTINGS = 'u/settings';
const URI_USER_UNLOCK = 'u/unlock';
const URI_USER_VIEW = 'u/view';
protected const NAME_USER_PRINT = 'user_print';
protected const NAME_USER_PS = 'user_ps';
protected const NAME_USER_REFRESH = 'user_refresh';
+ protected const NAME_USER_SESSION = 'user_session';
protected const NAME_USER_SETTINGS = 'user_settings';
protected const NAME_USER_UNLOCK = 'user_unlock';
protected const NAME_USER_VIEW = 'user_view';
protected const HANDLER_USER_PRINT = 'c_standard_path_user_print';
protected const HANDLER_USER_PS = 'c_standard_path_user_ps';
protected const HANDLER_USER_REFRESH = 'c_standard_path_user_refresh';
+ protected const HANDLER_USER_SESSION = 'c_standard_path_user_session';
protected const HANDLER_USER_SETTINGS = 'c_standard_path_user_settings';
protected const HANDLER_USER_UNLOCK = 'c_standard_path_user_unlock';
protected const HANDLER_USER_VIEW = 'c_standard_path_user_view';
protected function pr_paths_create_user() {
// dashboards
$this->paths->add_path(static::URI_USER_DASHBOARD, static::HANDLER_USER_DASHBOARD, static::PATH_USER, static::NAME_USER_DASHBOARD);
+ $this->paths->add_path(static::URI_USER_DASHBOARD . static::WILDCARD_PATH, static::HANDLER_USER_DASHBOARD, static::PATH_USER, static::NAME_USER_DASHBOARD);
- // user paths
- $this->paths->add_path(static::URI_USER_CHECK, static::HANDLER_USER_CHECK, static::PATH_USER, static::NAME_USER_CHECK);
- $this->paths->add_path(static::URI_USER_CHECK . static::WILDCARD_PATH, static::HANDLER_USER_CHECK, static::PATH_USER, static::NAME_USER_CHECK);
+ // pages / forms
$this->paths->add_path(static::URI_USER_CREATE, static::HANDLER_USER_CREATE, static::PATH_USER, static::NAME_USER_CREATE);
$this->paths->add_path(static::URI_USER_CREATE . static::WILDCARD_PATH, static::HANDLER_USER_CREATE, static::PATH_USER, static::NAME_USER_CREATE);
$this->paths->add_path(static::URI_USER_DELETE, static::HANDLER_USER_DELETE, static::PATH_USER, static::NAME_USER_DELETE);
$this->paths->add_path(static::URI_USER_DELETE . static::WILDCARD_PATH, static::HANDLER_USER_DELETE, static::PATH_USER, static::NAME_USER_DELETE);
$this->paths->add_path(static::URI_USER_EDIT, static::HANDLER_USER_EDIT, static::PATH_USER, static::NAME_USER_EDIT);
$this->paths->add_path(static::URI_USER_EDIT . static::WILDCARD_PATH, static::HANDLER_USER_EDIT, static::PATH_USER, static::NAME_USER_EDIT);
+ $this->paths->add_path(static::URI_USER_SETTINGS, static::HANDLER_USER_SETTINGS, static::PATH_USER, static::NAME_USER_SETTINGS);
+ $this->paths->add_path(static::URI_USER_SETTINGS . static::WILDCARD_PATH, static::HANDLER_USER_SETTINGS, static::PATH_USER, static::NAME_USER_SETTINGS);
+ $this->paths->add_path(static::URI_USER_VIEW, static::HANDLER_USER_VIEW, static::PATH_USER, static::NAME_USER_VIEW);
+ $this->paths->add_path(static::URI_USER_VIEW . static::WILDCARD_PATH, static::HANDLER_USER_VIEW, static::PATH_USER, static::NAME_USER_VIEW);
+
+ // actions / triggers
+ $this->paths->add_path(static::URI_USER_CHECK, static::HANDLER_USER_CHECK, static::PATH_USER, static::NAME_USER_CHECK);
+ $this->paths->add_path(static::URI_USER_CHECK . static::WILDCARD_PATH, static::HANDLER_USER_CHECK, static::PATH_USER, static::NAME_USER_CHECK);
$this->paths->add_path(static::URI_USER_LOCK, static::HANDLER_USER_LOCK, static::PATH_USER, static::NAME_USER_LOCK);
$this->paths->add_path(static::URI_USER_LOCK . static::WILDCARD_PATH, static::HANDLER_USER_LOCK, static::PATH_USER, static::NAME_USER_LOCK);
+ $this->paths->add_path(static::URI_USER_REFRESH, static::HANDLER_USER_REFRESH, static::PATH_USER, static::NAME_USER_REFRESH);
+ $this->paths->add_path(static::URI_USER_REFRESH . static::WILDCARD_PATH, static::HANDLER_USER_REFRESH, static::PATH_USER, static::NAME_USER_REFRESH);
+ $this->paths->add_path(static::URI_USER_SESSION, static::HANDLER_USER_SESSION, static::PATH_USER, static::NAME_USER_SESSION);
+ $this->paths->add_path(static::URI_USER_SESSION . static::WILDCARD_PATH, static::HANDLER_USER_SESSION, static::PATH_USER, static::NAME_USER_SESSION);
+ $this->paths->add_path(static::URI_USER_UNLOCK, static::HANDLER_USER_UNLOCK, static::PATH_USER, static::NAME_USER_UNLOCK);
+ $this->paths->add_path(static::URI_USER_UNLOCK . static::WILDCARD_PATH, static::HANDLER_USER_UNLOCK, static::PATH_USER, static::NAME_USER_UNLOCK);
+
+ // presentation / formats
$this->paths->add_path(static::URI_USER_PDF, static::HANDLER_USER_PDF, static::PATH_USER, static::NAME_USER_PDF);
$this->paths->add_path(static::URI_USER_PDF . static::WILDCARD_PATH, static::HANDLER_USER_PDF, static::PATH_USER, static::NAME_USER_PDF);
$this->paths->add_path(static::URI_USER_PRINT, static::HANDLER_USER_PRINT, static::PATH_USER, static::NAME_USER_PRINT);
$this->paths->add_path(static::URI_USER_PRINT . static::WILDCARD_PATH, static::HANDLER_USER_PRINT, static::PATH_USER, static::NAME_USER_PRINT);
$this->paths->add_path(static::URI_USER_PS, static::HANDLER_USER_PS, static::PATH_USER, static::NAME_USER_PS);
$this->paths->add_path(static::URI_USER_PS . static::WILDCARD_PATH, static::HANDLER_USER_PS, static::PATH_USER, static::NAME_USER_PS);
- $this->paths->add_path(static::URI_USER_REFRESH, static::HANDLER_USER_REFRESH, static::PATH_USER, static::NAME_USER_REFRESH);
- $this->paths->add_path(static::URI_USER_REFRESH . static::WILDCARD_PATH, static::HANDLER_USER_REFRESH, static::PATH_USER, static::NAME_USER_REFRESH);
- $this->paths->add_path(static::URI_USER_SETTINGS, static::HANDLER_USER_SETTINGS, static::PATH_USER, static::NAME_USER_SETTINGS);
- $this->paths->add_path(static::URI_USER_SETTINGS . static::WILDCARD_PATH, static::HANDLER_USER_SETTINGS, static::PATH_USER, static::NAME_USER_SETTINGS);
- $this->paths->add_path(static::URI_USER_UNLOCK, static::HANDLER_USER_UNLOCK, static::PATH_USER, static::NAME_USER_UNLOCK);
- $this->paths->add_path(static::URI_USER_UNLOCK . static::WILDCARD_PATH, static::HANDLER_USER_UNLOCK, static::PATH_USER, static::NAME_USER_UNLOCK);
- $this->paths->add_path(static::URI_USER_VIEW, static::HANDLER_USER_VIEW, static::PATH_USER, static::NAME_USER_VIEW);
- $this->paths->add_path(static::URI_USER_VIEW . static::WILDCARD_PATH, static::HANDLER_USER_VIEW, static::PATH_USER, static::NAME_USER_VIEW);
}
/**
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides a language specific class.
+ */
+require_once('common/standard/menus/menu_content.php');
+
+/**
+ * A path-specific class for managing a content menu.
+ */
+class c_standard_menu_content_user_view_ja extends c_standard_menu_content_user_view {
+
+ /**
+ * Implements pr_get_text().
+ */
+ protected function pr_get_text($code, $arguments = array()) {
+ $string = '';
+ switch ($code) {
+ case 0:
+ $string = 'User Menu';
+ break;
+ case 1:
+ $string = 'Profile';
+ break;
+ case 2:
+ $string = 'Dashboard';
+ break;
+ case 3:
+ $string = 'Settings';
+ break;
+ case 4:
+ $string = 'Edit';
+ break;
+ case 5:
+ $string = 'Check';
+ break;
+ case 6:
+ $string = 'Refresh';
+ break;
+ case 7:
+ $string = 'Lock';
+ break;
+ case 8:
+ $string = 'Unlock';
+ break;
+ case 9:
+ $string = 'Delete';
+ break;
+ case 10:
+ $string = 'Copy'; // @todo: implement this in the project.
+ break;
+ case 11:
+ $string = 'Create New User';
+ break;
+ }
+
+ if (!empty($arguments)) {
+ $this->pr_process_replacements($string, $arguments);
+ }
+
+ return $string;
+ }
+}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides a class for a path-specific content menu.
+ */
+require_once('common/base/classes/base_markup.php');
+
+require_once('common/standard/classes/standard_menu.php');
+require_once('common/standard/classes/standard_paths.php');
+require_once('common/standard/menus/menu_content.php');
+
+/**
+ * A path-specific class for managing a content menu.
+ */
+class c_standard_menu_content_user_view extends c_standard_menu_content {
+ protected const CLASS_USER_CHECK = 'user-check';
+ protected const CLASS_USER_CREATE = 'user-create';
+ protected const CLASS_USER_COPY = 'user-copy';
+ protected const CLASS_USER_DASHBOARD = 'user-dashboard';
+ protected const CLASS_USER_DELETE = 'user-delete';
+ protected const CLASS_USER_EDIT = 'user-edit';
+ protected const CLASS_USER_LOCK = 'user-lock';
+ protected const CLASS_USER_REFRESH = 'user-refresh';
+ protected const CLASS_USER_SETTINGS = 'user-settings';
+ protected const CLASS_USER_UNLOCK = 'user-unlock';
+ protected const CLASS_USER_VIEW = 'user-view';
+
+ /**
+ * Implements do_prepare().
+ */
+ public function do_build(&$http, &$database, &$session, $settings, $items = NULL) {
+ $result = parent::do_build($http, $database, $session, $settings);
+ if (c_base_return::s_has_error($result)) {
+ return $result;
+ }
+ unset($result);
+
+ if ($session->is_logged_in() instanceof c_base_return_false) {
+ return new c_base_return_false();
+ }
+
+ // @todo: this path should either have no trailing id if current user is viewing their own profile or it should have the user id appended for all urls below.
+ $path_id_user = '';
+
+ $menu = $this->pr_create_html_create_menu($settings['base_css'] . static::CLASS_NAME, $this->pr_get_text(0));
+
+ $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(1), $settings['base_path'] . c_standard_paths::URI_USER_VIEW . $path_id_user);
+ $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_VIEW);
+ $menu->set_tag($item);
+ unset($item);
+
+ $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(2), $settings['base_path'] . c_standard_paths::URI_USER_DASHBOARD . $path_id_user);
+ $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_DASHBOARD);
+ $menu->set_tag($item);
+ unset($item);
+
+ $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(3), $settings['base_path'] . c_standard_paths::URI_USER_SETTINGS . $path_id_user);
+ $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_SETTINGS);
+ $menu->set_tag($item);
+ unset($item);
+
+ // @todo: add access check to this menu item and only make it appear to authorized users.
+ $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(4), $settings['base_path'] . c_standard_paths::URI_USER_EDIT . $path_id_user);
+ $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_EDIT);
+ $menu->set_tag($item);
+ unset($item);
+
+ $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(5), $settings['base_path'] . c_standard_paths::URI_USER_CHECK . $path_id_user);
+ $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_CHECK);
+ $menu->set_tag($item);
+ unset($item);
+
+ $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(6), $settings['base_path'] . c_standard_paths::URI_USER_REFRESH . $path_id_user);
+ $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_REFRESH);
+ $menu->set_tag($item);
+ unset($item);
+
+ $roles = $session->get_user_current()->get_roles()->get_value_exact();
+ if (array_key_exists(c_base_roles::MANAGER, $roles) || array_key_exists(c_base_roles::ADMINISTER, $roles)) {
+ // @todo: only show lock user if account is unlocked.
+ $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(7), $settings['base_path'] . c_standard_paths::URI_USER_LOCK . $path_id_user);
+ $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_LOCK);
+ $menu->set_tag($item);
+ unset($item);
+
+ // @todo: only show unlock user if account is locked.
+ $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(8), $settings['base_path'] . c_standard_paths::URI_USER_UNLOCK . $path_id_user);
+ $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_UNLOCK);
+ $menu->set_tag($item);
+ unset($item);
+
+ $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(9), $settings['base_path'] . c_standard_paths::URI_USER_DELETE . $path_id_user);
+ $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_DELETE);
+ $menu->set_tag($item);
+ unset($item);
+
+ $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(10), $settings['base_path'] . c_standard_paths::URI_USER_COPY . $path_id_user);
+ $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_COPY);
+ $menu->set_tag($item);
+ unset($item);
+
+ $item = $this->pr_create_html_add_menu_item_link($this->pr_get_text(11), $settings['base_path'] . c_standard_paths::URI_USER_CREATE);
+ $item->set_attribute(c_base_markup_attributes::ATTRIBUTE_CLASS, static::CLASS_USER_CREATE);
+ $menu->set_tag($item);
+ unset($item);
+ }
+ unset($roles);
+
+ return $menu;
+ }
+
+ /**
+ * Implements pr_get_text().
+ */
+ protected function pr_get_text($code, $arguments = array()) {
+ $string = '';
+ switch ($code) {
+ case 0:
+ $string = 'User Menu';
+ break;
+ case 1:
+ $string = 'Profile';
+ break;
+ case 2:
+ $string = 'Dashboard';
+ break;
+ case 3:
+ $string = 'Settings';
+ break;
+ case 4:
+ $string = 'Edit';
+ break;
+ case 5:
+ $string = 'Check';
+ break;
+ case 6:
+ $string = 'Refresh';
+ break;
+ case 7:
+ $string = 'Lock';
+ break;
+ case 8:
+ $string = 'Unlock';
+ break;
+ case 9:
+ $string = 'Delete';
+ break;
+ case 10:
+ $string = 'Copy'; // @todo: implement this in the project.
+ break;
+ case 11:
+ $string = 'Create New User';
+ break;
+ }
+
+ if (!empty($arguments)) {
+ $this->pr_process_replacements($string, $arguments);
+ }
+
+ return $string;
+ }
+}
$string = 'Administration';
break;
case 6:
- $string = 'Settings';
+ $string = 'Profile';
break;
case 7:
$string = 'Logout';
require_once('common/theme/classes/theme_html.php');
class c_standard_path_administer_dashboard extends c_standard_path {
- protected const PATH_SELF = 'a/dashboard';
+ public const PATH_SELF = 'a/dashboard';
/**
* Implements do_execute().
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
require_once('common/theme/classes/theme_html.php');
class c_standard_path_management_dashboard extends c_standard_path {
- protected const PATH_SELF = 'm/dashboard';
+ public const PATH_SELF = 'm/dashboard';
/**
* Implements do_execute().
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
protected function pr_get_text($code, $arguments = array()) {
$string = '';
switch ($code) {
+ case 0:
if (array_key_exists(':{user_name}', $arguments)) {
$string = '照合:{user_name}';
}
$string = '照合';
}
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
protected function pr_get_text($code, $arguments = array()) {
$string = '';
switch ($code) {
+ case 0:
if (array_key_exists(':{user_name}', $arguments)) {
$string = 'ユーザーをコピー:{user_name}';
}
$string = 'ユーザーを作成する';
}
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
$string = 'ユーザーを削除する';
}
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
protected function pr_get_text($code, $arguments = array()) {
$string = '';
switch ($code) {
+ case 0:
if (array_key_exists(':{user_name}', $arguments)) {
$string = 'ユーザーを編集:{user_name}';
}
$string = 'ユーザーを編集する';
}
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
$string = 'ユーザーをロックする';
}
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
case 0:
$string = '';
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
case 0:
$string = '';
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
case 0:
$string = '';
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
protected function pr_get_text($code, $arguments = array()) {
$string = '';
switch ($code) {
+ case 0:
if (array_key_exists(':{user_name}', $arguments)) {
$string = '晴らす:{user_name}';
}
$string = '晴らす';
}
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides path handler for the user session actions.
+ */
+
+/**
+ * Implements c_standard_path_user_session().
+ */
+class c_standard_path_user_session_ja extends c_standard_path_user_session {
+
+ /**
+ * Implements pr_get_text().
+ */
+ protected function pr_get_text($code, $arguments = array()) {
+ return '';
+ }
+}
case 15:
$string = '管理者';
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
$string = 'ユーザーをロック解除する';
}
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
case 63:
$string = 'アクセス履歴';
break;
+ default:
+ unset($string);
+ return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
require_once('common/base/classes/base_path.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
+require_once('common/standard/paths/u/user_view.php');
require_once('common/theme/classes/theme_html.php');
*
* This listens on: /u/check
*/
-class c_standard_path_user_check extends c_standard_path {
- protected const PATH_SELF = 'u/check';
+class c_standard_path_user_check extends c_standard_path_user {
+ public const PATH_SELF = 'u/check';
+
+ protected const NAME_MENU_CONTENT = 'menu_content_user_view';
+ protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
/**
* Implements do_execute().
return $executed;
}
+ // @todo: this function needs to check to see if the user has administer (or manager?) roles (c_base_roles::MANAGER, c_base_roles::ADMINISTER) and if they do, set administrative to TRUE when calling do_load().
+ $user = $this->session->get_user_current();
+ $roles_current = $user->get_roles()->get_value_exact();
+
+ $id_user = NULL;
+ $arguments = $this->pr_get_path_arguments(static::PATH_SELF);
+ if (!empty($arguments)) {
+ $arguments_total = count($arguments);
+ $argument = reset($arguments);
+
+ if (is_numeric($argument)) {
+ $id_user = (int) $argument;
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+
+ // @todo: check to see if user id is valid and accessible.
+ // If the current viewer cannot access the user, then deny access to this page as appropriate.
+ }
+ else {
+ unset($arguments_total);
+ unset($argument);
+ unset($id_user);
+ unset($user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+
+ if ($arguments_total > 1) {
+ $argument = next($arguments);
+
+ if ($argument == 'print') {
+ // @todo: execute custom print function and then return.
+ $id_user = NULL;
+ }
+ #elseif ($argument == 'pdf') {
+ # // @todo: execute custom pdf function and then return.
+ # $id_user = NULL;
+ #}
+ #elseif ($argument == 'ps') {
+ # // @todo: execute custom postscript function and then return.
+ # $id_user = NULL;
+ #}
+ else {
+ $id_user = FALSE;
+ }
+ }
+ unset($arguments_total);
+ unset($argument);
+
+ if ($id_user === FALSE) {
+ unset($user);
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+ }
+
+ $user = NULL;
+ if (is_null($id_user)) {
+ $user = $this->session->get_user_current();
+ $id_user = $user->get_id()->get_value_exact();
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+ }
+ else {
+ $user = new c_standard_users_user();
+
+ // @todo: handle database errors.
+ $loaded = $user->do_load($this->database, $id_user);
+ if ($loaded instanceof c_base_return_false) {
+ $id_user = FALSE;
+ }
+ unset($loaded);
+ }
+
+ if ($id_user === FALSE) {
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+
+ return $executed;
+ }
+ unset($arguments);
+ unset($id_user);
+
$wrapper = $this->pr_create_tag_section(array(1 => 0));
// initialize the content as HTML.
* Implementation of pr_build_breadcrumbs().
*/
protected function pr_build_breadcrumbs() {
- $result = parent::pr_build_breadcrumbs();
- if ($result instanceof c_base_return_false) {
+ $path_user_view = new c_standard_path_user_view();
+ $path_user_view->set_parameters($this->http, $this->database, $this->session, $this->settings);
+ $path_user_view->set_path_tree($this->get_path_tree($this->path_tree));
+ $this->breadcrumbs = $path_user_view->get_breadcrumbs();
+ unset($path_user_view);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
unset($result);
- return new c_base_return_false();
}
- unset($result);
if (!($this->breadcrumbs instanceof c_base_menu_item)) {
$this->breadcrumbs = new c_base_menu_item();
}
- $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), static::PATH_SELF);
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
$this->breadcrumbs->set_item($item);
unset($item);
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
/**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
* Implements pr_get_text().
*/
protected function pr_get_text($code, $arguments = array()) {
<?php
/**
* @file
- * Provides path handler for the user create.
+ * Provides path handler for the user create/copy.
*/
require_once('common/base/classes/base_error.php');
require_once('common/base/classes/base_path.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
+require_once('common/standard/paths/u/user_view.php');
require_once('common/theme/classes/theme_html.php');
/**
* Provides a path handler for user creation.
*
+ * By supplying a user id argument, this create instead functions as a create from the given user (aka: copy).
+ *
* This listens on: /u/create
*/
-class c_standard_path_user_create extends c_standard_path {
- protected const PATH_SELF = 'u/create';
+class c_standard_path_user_create extends c_standard_path_user {
+ public const PATH_SELF = 'u/create';
/**
* Implements do_execute().
return $executed;
}
+ // @todo: this function needs to check to see if the user has administer (or manager?) roles (c_base_roles::MANAGER, c_base_roles::ADMINISTER) and if they do, set administrative to TRUE when calling do_load().
+ $user = $this->session->get_user_current();
+ $roles_current = $user->get_roles()->get_value_exact();
+
+ $id_user = NULL;
+ $arguments = $this->pr_get_path_arguments(static::PATH_SELF);
+ if (!empty($arguments)) {
+ $arguments_total = count($arguments);
+ $argument = reset($arguments);
+
+ if (is_numeric($argument)) {
+ $id_user = (int) $argument;
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+
+ // @todo: check to see if user id is valid and accessible.
+ // If the current viewer cannot access the user, then deny access to this page as appropriate.
+ }
+ else {
+ unset($arguments_total);
+ unset($argument);
+ unset($id_user);
+ unset($user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+
+ if ($arguments_total > 1) {
+ $argument = next($arguments);
+
+ if ($argument == 'print') {
+ // @todo: execute custom print function and then return.
+ $id_user = NULL;
+ }
+ #elseif ($argument == 'pdf') {
+ # // @todo: execute custom pdf function and then return.
+ # $id_user = NULL;
+ #}
+ #elseif ($argument == 'ps') {
+ # // @todo: execute custom postscript function and then return.
+ # $id_user = NULL;
+ #}
+ else {
+ $id_user = FALSE;
+ }
+ }
+ unset($arguments_total);
+ unset($argument);
+
+ if ($id_user === FALSE) {
+ unset($user);
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+ }
+
+ $user = NULL;
+ if (is_null($id_user)) {
+ $user = $this->session->get_user_current();
+ $id_user = $user->get_id()->get_value_exact();
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+ }
+ else {
+ $user = new c_standard_users_user();
+
+ // @todo: handle database errors.
+ $loaded = $user->do_load($this->database, $id_user);
+ if ($loaded instanceof c_base_return_false) {
+ $id_user = FALSE;
+ }
+ unset($loaded);
+ }
+
+ if ($id_user === FALSE) {
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+
+ return $executed;
+ }
+ unset($arguments);
+ unset($id_user);
+
$wrapper = $this->pr_create_tag_section(array(1 => 0));
// initialize the content as HTML.
* Implementation of pr_build_breadcrumbs().
*/
protected function pr_build_breadcrumbs() {
- $result = parent::pr_build_breadcrumbs();
- if ($result instanceof c_base_return_false) {
+ $path_user_view = new c_standard_path_user_view();
+ $path_user_view->set_parameters($this->http, $this->database, $this->session, $this->settings);
+ $path_user_view->set_path_tree($this->get_path_tree($this->path_tree));
+ $this->breadcrumbs = $path_user_view->get_breadcrumbs();
+ unset($path_user_view);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
unset($result);
- return new c_base_return_false();
}
- unset($result);
if (!($this->breadcrumbs instanceof c_base_menu_item)) {
$this->breadcrumbs = new c_base_menu_item();
}
- $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), static::PATH_SELF);
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
$this->breadcrumbs->set_item($item);
unset($item);
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
/**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
* Implements pr_get_text().
*/
protected function pr_get_text($code, $arguments = array()) {
require_once('common/base/classes/base_path.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
require_once('common/theme/classes/theme_html.php');
*
* This listens on: /u/dashboard
*/
-class c_standard_path_user_dashboard extends c_standard_path {
- protected const PATH_SELF = 'u/dashboard';
+class c_standard_path_user_dashboard extends c_standard_path_user {
+ public const PATH_SELF = 'u/dashboard';
/**
* Implementation of pr_build_breadcrumbs().
$this->breadcrumbs = new c_base_menu_item();
}
- $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), static::PATH_SELF);
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
$this->breadcrumbs->set_item($item);
unset($item);
return $executed;
}
+ // @todo: this function needs to check to see if the user has administer (or manager?) roles (c_base_roles::MANAGER, c_base_roles::ADMINISTER) and if they do, set administrative to TRUE when calling do_load().
+ $user = $this->session->get_user_current();
+ $roles_current = $user->get_roles()->get_value_exact();
+
+ $id_user = NULL;
+ $arguments = $this->pr_get_path_arguments(static::PATH_SELF);
+ if (!empty($arguments)) {
+ $arguments_total = count($arguments);
+ $argument = reset($arguments);
+
+ if (is_numeric($argument)) {
+ $id_user = (int) $argument;
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+
+ // @todo: check to see if user id is valid and accessible.
+ // If the current viewer cannot access the user, then deny access to this page as appropriate.
+ }
+ else {
+ unset($arguments_total);
+ unset($argument);
+ unset($id_user);
+ unset($user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+
+ if ($arguments_total > 1) {
+ $argument = next($arguments);
+
+ if ($argument == 'print') {
+ // @todo: execute custom print function and then return.
+ $id_user = NULL;
+ }
+ #elseif ($argument == 'pdf') {
+ # // @todo: execute custom pdf function and then return.
+ # $id_user = NULL;
+ #}
+ #elseif ($argument == 'ps') {
+ # // @todo: execute custom postscript function and then return.
+ # $id_user = NULL;
+ #}
+ else {
+ $id_user = FALSE;
+ }
+ }
+ unset($arguments_total);
+ unset($argument);
+
+ if ($id_user === FALSE) {
+ unset($user);
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+ }
+
+ $user = NULL;
+ if (is_null($id_user)) {
+ $user = $this->session->get_user_current();
+ $id_user = $user->get_id()->get_value_exact();
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+ }
+ else {
+ $user = new c_standard_users_user();
+
+ // @todo: handle database errors.
+ $loaded = $user->do_load($this->database, $id_user);
+ if ($loaded instanceof c_base_return_false) {
+ $id_user = FALSE;
+ }
+ unset($loaded);
+ }
+
+ if ($id_user === FALSE) {
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+
+ return $executed;
+ }
+ unset($arguments);
+ unset($id_user);
+
$wrapper = $this->pr_create_tag_section(array(1 => 0));
$wrapper->set_tag($this->pr_create_tag_text_block(1));
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
/**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
* Implements pr_get_text().
*/
protected function pr_get_text($code, $arguments = array()) {
require_once('common/base/classes/base_path.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
+require_once('common/standard/paths/u/user_view.php');
require_once('common/theme/classes/theme_html.php');
*
* This listens on: /u/delete
*/
-class c_standard_path_user_delete extends c_standard_path {
- protected const PATH_SELF = 'u/delete';
+class c_standard_path_user_delete extends c_standard_path_user {
+ public const PATH_SELF = 'u/delete';
+
+ protected const NAME_MENU_CONTENT = 'menu_content_user_view';
+ protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
/**
* Implements do_execute().
return $executed;
}
+ // @todo: this function needs to check to see if the user has administer (or manager?) roles (c_base_roles::MANAGER, c_base_roles::ADMINISTER) and if they do, set administrative to TRUE when calling do_load().
+ $user = $this->session->get_user_current();
+ $roles_current = $user->get_roles()->get_value_exact();
+
+ $id_user = NULL;
+ $arguments = $this->pr_get_path_arguments(static::PATH_SELF);
+ if (!empty($arguments)) {
+ $arguments_total = count($arguments);
+ $argument = reset($arguments);
+
+ if (is_numeric($argument)) {
+ $id_user = (int) $argument;
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+
+ // @todo: check to see if user id is valid and accessible.
+ // If the current viewer cannot access the user, then deny access to this page as appropriate.
+ }
+ else {
+ unset($arguments_total);
+ unset($argument);
+ unset($id_user);
+ unset($user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+
+ if ($arguments_total > 1) {
+ $argument = next($arguments);
+
+ if ($argument == 'print') {
+ // @todo: execute custom print function and then return.
+ $id_user = NULL;
+ }
+ #elseif ($argument == 'pdf') {
+ # // @todo: execute custom pdf function and then return.
+ # $id_user = NULL;
+ #}
+ #elseif ($argument == 'ps') {
+ # // @todo: execute custom postscript function and then return.
+ # $id_user = NULL;
+ #}
+ else {
+ $id_user = FALSE;
+ }
+ }
+ unset($arguments_total);
+ unset($argument);
+
+ if ($id_user === FALSE) {
+ unset($user);
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+ }
+
+ $user = NULL;
+ if (is_null($id_user)) {
+ $user = $this->session->get_user_current();
+ $id_user = $user->get_id()->get_value_exact();
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+ }
+ else {
+ $user = new c_standard_users_user();
+
+ // @todo: handle database errors.
+ $loaded = $user->do_load($this->database, $id_user);
+ if ($loaded instanceof c_base_return_false) {
+ $id_user = FALSE;
+ }
+ unset($loaded);
+ }
+
+ if ($id_user === FALSE) {
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+
+ return $executed;
+ }
+ unset($arguments);
+ unset($id_user);
+
$wrapper = $this->pr_create_tag_section(array(1 => 0));
// initialize the content as HTML.
* Implementation of pr_build_breadcrumbs().
*/
protected function pr_build_breadcrumbs() {
- $result = parent::pr_build_breadcrumbs();
- if ($result instanceof c_base_return_false) {
+ $path_user_view = new c_standard_path_user_view();
+ $path_user_view->set_parameters($this->http, $this->database, $this->session, $this->settings);
+ $path_user_view->set_path_tree($this->get_path_tree($this->path_tree));
+ $this->breadcrumbs = $path_user_view->get_breadcrumbs();
+ unset($path_user_view);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
unset($result);
- return new c_base_return_false();
}
- unset($result);
if (!($this->breadcrumbs instanceof c_base_menu_item)) {
$this->breadcrumbs = new c_base_menu_item();
}
- $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), static::PATH_SELF);
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
$this->breadcrumbs->set_item($item);
unset($item);
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
/**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
* Implements pr_get_text().
*/
protected function pr_get_text($code, $arguments = array()) {
require_once('common/base/classes/base_path.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
+require_once('common/standard/paths/u/user_view.php');
require_once('common/theme/classes/theme_html.php');
*
* This listens on: /u/edit
*/
-class c_standard_path_user_edit extends c_standard_path {
- protected const PATH_SELF = 'u/edit';
+class c_standard_path_user_edit extends c_standard_path_user {
+ public const PATH_SELF = 'u/edit';
+
+ protected const NAME_MENU_CONTENT = 'menu_content_user_view';
+ protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
protected const CLASS_USER_EDIT_ACCOUNT = 'user_settings-account';
protected const CLASS_USER_EDIT_PERSONAL = 'user_settings-personal';
* Implementation of pr_build_breadcrumbs().
*/
protected function pr_build_breadcrumbs() {
- parent::pr_build_breadcrumbs();
+ $path_user_view = new c_standard_path_user_view();
+ $path_user_view->set_parameters($this->http, $this->database, $this->session, $this->settings);
+ $path_user_view->set_path_tree($this->get_path_tree($this->path_tree));
+ $this->breadcrumbs = $path_user_view->get_breadcrumbs();
+ unset($path_user_view);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
+ unset($result);
+ }
- $item = $this->pr_create_breadcrumbs_item($this->pr_get_text_breadcrumbs(1), static::PATH_SELF);
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $this->breadcrumbs = new c_base_menu_item();
+ }
+
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
$this->breadcrumbs->set_item($item);
unset($item);
return $executed;
}
- $this->pr_assign_defaults($http, $database, $session, $settings);
+ // @todo: this function needs to check to see if the user has administer (or manager?) roles (c_base_roles::MANAGER, c_base_roles::ADMINISTER) and if they do, set administrative to TRUE when calling do_load().
+ $user = $this->session->get_user_current();
+ $roles_current = $user->get_roles()->get_value_exact();
+
+ $id_user = NULL;
+ $arguments = $this->pr_get_path_arguments(static::PATH_SELF);
+ if (!empty($arguments)) {
+ $arguments_total = count($arguments);
+ $argument = reset($arguments);
+
+ if (is_numeric($argument)) {
+ $id_user = (int) $argument;
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+
+ // @todo: check to see if user id is valid and accessible.
+ // If the current viewer cannot access the user, then deny access to this page as appropriate.
+ }
+ else {
+ unset($arguments_total);
+ unset($argument);
+ unset($id_user);
+ unset($user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+
+ if ($arguments_total > 1) {
+ $argument = next($arguments);
+
+ if ($argument == 'print') {
+ // @todo: execute custom print function and then return.
+ $id_user = NULL;
+ }
+ #elseif ($argument == 'pdf') {
+ # // @todo: execute custom pdf function and then return.
+ # $id_user = NULL;
+ #}
+ #elseif ($argument == 'ps') {
+ # // @todo: execute custom postscript function and then return.
+ # $id_user = NULL;
+ #}
+ else {
+ $id_user = FALSE;
+ }
+ }
+ unset($arguments_total);
+ unset($argument);
+
+ if ($id_user === FALSE) {
+ unset($user);
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+ }
+
+ $user = NULL;
+ if (is_null($id_user)) {
+ $user = $this->session->get_user_current();
+ $id_user = $user->get_id()->get_value_exact();
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+ }
+ else {
+ $user = new c_standard_users_user();
+
+ // @todo: handle database errors.
+ $loaded = $user->do_load($this->database, $id_user);
+ if ($loaded instanceof c_base_return_false) {
+ $id_user = FALSE;
+ }
+ unset($loaded);
+ }
+
+ if ($id_user === FALSE) {
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+
+ return $executed;
+ }
+ unset($arguments);
+ unset($id_user);
$wrapper = $this->pr_create_tag_section(array(1 => 0));
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
/**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
* Implements pr_get_text().
*/
protected function pr_get_text($code, $arguments = array()) {
require_once('common/base/classes/base_path.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
+require_once('common/standard/paths/u/user_view.php');
require_once('common/theme/classes/theme_html.php');
*
* This listens on: /u/lock
*/
-class c_standard_path_user_lock extends c_standard_path {
- protected const PATH_SELF = 'u/lock';
+class c_standard_path_user_lock extends c_standard_path_user {
+ public const PATH_SELF = 'u/lock';
+
+ protected const NAME_MENU_CONTENT = 'menu_content_user_view';
+ protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
/**
* Implements do_execute().
return $executed;
}
+ // @todo: this function needs to check to see if the user has administer (or manager?) roles (c_base_roles::MANAGER, c_base_roles::ADMINISTER) and if they do, set administrative to TRUE when calling do_load().
+ $user = $this->session->get_user_current();
+ $roles_current = $user->get_roles()->get_value_exact();
+
+ $id_user = NULL;
+ $arguments = $this->pr_get_path_arguments(static::PATH_SELF);
+ if (!empty($arguments)) {
+ $arguments_total = count($arguments);
+ $argument = reset($arguments);
+
+ if (is_numeric($argument)) {
+ $id_user = (int) $argument;
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+
+ // @todo: check to see if user id is valid and accessible.
+ // If the current viewer cannot access the user, then deny access to this page as appropriate.
+ }
+ else {
+ unset($arguments_total);
+ unset($argument);
+ unset($id_user);
+ unset($user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+
+ if ($arguments_total > 1) {
+ $argument = next($arguments);
+
+ if ($argument == 'print') {
+ // @todo: execute custom print function and then return.
+ $id_user = NULL;
+ }
+ #elseif ($argument == 'pdf') {
+ # // @todo: execute custom pdf function and then return.
+ # $id_user = NULL;
+ #}
+ #elseif ($argument == 'ps') {
+ # // @todo: execute custom postscript function and then return.
+ # $id_user = NULL;
+ #}
+ else {
+ $id_user = FALSE;
+ }
+ }
+ unset($arguments_total);
+ unset($argument);
+
+ if ($id_user === FALSE) {
+ unset($user);
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+ }
+
+ $user = NULL;
+ if (is_null($id_user)) {
+ $user = $this->session->get_user_current();
+ $id_user = $user->get_id()->get_value_exact();
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+ }
+ else {
+ $user = new c_standard_users_user();
+
+ // @todo: handle database errors.
+ $loaded = $user->do_load($this->database, $id_user);
+ if ($loaded instanceof c_base_return_false) {
+ $id_user = FALSE;
+ }
+ unset($loaded);
+ }
+
+ if ($id_user === FALSE) {
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+
+ return $executed;
+ }
+ unset($arguments);
+ unset($id_user);
+
$wrapper = $this->pr_create_tag_section(array(1 => 0));
// initialize the content as HTML.
* Implementation of pr_build_breadcrumbs().
*/
protected function pr_build_breadcrumbs() {
- $result = parent::pr_build_breadcrumbs();
- if ($result instanceof c_base_return_false) {
+ $path_user_view = new c_standard_path_user_view();
+ $path_user_view->set_parameters($this->http, $this->database, $this->session, $this->settings);
+ $path_user_view->set_path_tree($this->get_path_tree($this->path_tree));
+ $this->breadcrumbs = $path_user_view->get_breadcrumbs();
+ unset($path_user_view);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
unset($result);
- return new c_base_return_false();
}
- unset($result);
if (!($this->breadcrumbs instanceof c_base_menu_item)) {
$this->breadcrumbs = new c_base_menu_item();
}
- $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), static::PATH_SELF);
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
$this->breadcrumbs->set_item($item);
unset($item);
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
/**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
* Implements pr_get_text().
*/
protected function pr_get_text($code, $arguments = array()) {
*/
class c_standard_path_user_login extends c_standard_path {
public const SESSION_DATE_FORMAT = 'D, d-M-Y H:i:s T';
+ public const PATH_SELF = 'u/login';
- protected const PATH_SELF = 'u/login';
protected const USER_PUBLIC = 'u_standard_public';
/**
$this->breadcrumbs = new c_base_menu_item();
}
- $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(12), static::PATH_SELF);
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(12), self::PATH_SELF);
$this->breadcrumbs->set_item($item);
unset($item);
* Implements pr_get_text_title().
*/
protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
+ return self::pr_get_text(0, $arguments);
}
/**
$this->breadcrumbs = new c_base_menu_item();
}
- $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), static::PATH_SELF);
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
$this->breadcrumbs->set_item($item);
unset($item);
require_once('common/base/classes/base_path.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
require_once('common/theme/classes/theme_html.php');
/**
* Provides a path handler for user in pdf format.
*
+ * @fixme: this should probably be renamed to c_standard_path_user_view_pdf.
+ *
* This listens on: /u/pdf
*/
-class c_standard_path_user_pdf extends c_standard_path {
- protected const PATH_SELF = 'u/pdf';
+class c_standard_path_user_pdf extends c_standard_path_user_view {
+ public const PATH_SELF = 'u/pdf'; // @fixme: make path 'u/pdf/view'.
/**
* Implements do_execute().
return $executed;
}
- $this->pr_assign_defaults($http, $database, $session, $settings);
-
$wrapper = $this->pr_create_tag_section(array(1 => 0));
// initialize the content as HTML.
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
-
- /**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
- * Implements pr_get_text().
- */
- protected function pr_get_text($code, $arguments = array()) {
- $string = '';
- switch ($code) {
- case 0:
- $string = 'Lock User';
- break;
- }
-
- if (!empty($arguments)) {
- $this->pr_process_replacements($string, $arguments);
- }
-
- return $string;
- }
}
require_once('common/base/classes/base_path.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
require_once('common/theme/classes/theme_html.php');
/**
* Provides a path handler for user print format (printer-friendly).
*
+ * @fixme: this should probably be renamed to c_standard_path_user_view_print.
+ *
* This listens on: /u/print
*/
-class c_standard_path_user_print extends c_standard_path {
- protected const PATH_SELF = 'u/print';
+class c_standard_path_user_print extends c_standard_path_user_view {
+ public const PATH_SELF = 'u/print'; // @fixme: make path 'u/print/view'.
/**
* Implements do_execute().
return $executed;
}
- $this->pr_assign_defaults($http, $database, $session, $settings);
-
$wrapper = $this->pr_create_tag_section(array(1 => 0));
// initialize the content as HTML.
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
-
- /**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
- * Implements pr_get_text().
- */
- protected function pr_get_text($code, $arguments = array()) {
- $string = '';
- switch ($code) {
- case 0:
- $string = 'Lock User';
- break;
- }
-
- if (!empty($arguments)) {
- $this->pr_process_replacements($string, $arguments);
- }
-
- return $string;
- }
}
require_once('common/base/classes/base_path.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
require_once('common/theme/classes/theme_html.php');
/**
* Provides a path handler for user postcript (postcript format).
*
+ * @fixme: this should probably be renamed to c_standard_path_user_view_ps.
+ *
* This listens on: /u/ps
*/
-class c_standard_path_user_ps extends c_standard_path {
- protected const PATH_SELF = 'u/ps';
+class c_standard_path_user_ps extends c_standard_path_user_view {
+ public const PATH_SELF = 'u/ps'; // @fixme: make path 'u/ps/view'.
/**
* Implements do_execute().
return $executed;
}
- $this->pr_assign_defaults($http, $database, $session, $settings);
-
$wrapper = $this->pr_create_tag_section(array(1 => 0));
// initialize the content as HTML.
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
-
- /**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
- * Implements pr_get_text().
- */
- protected function pr_get_text($code, $arguments = array()) {
- $string = '';
- switch ($code) {
- case 0:
- $string = 'Lock User';
- break;
- }
-
- if (!empty($arguments)) {
- $this->pr_process_replacements($string, $arguments);
- }
-
- return $string;
- }
}
require_once('common/base/classes/base_path.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
+require_once('common/standard/paths/u/user_view.php');
require_once('common/theme/classes/theme_html.php');
*
* This listens on: /u/refresh
*/
-class c_standard_path_user_refresh extends c_standard_path {
- protected const PATH_SELF = 'u/refresh';
+class c_standard_path_user_refresh extends c_standard_path_user {
+ public const PATH_SELF = 'u/refresh';
+
+ protected const NAME_MENU_CONTENT = 'menu_content_user_view';
+ protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
/**
* Implements do_execute().
return $executed;
}
+ // @todo: this function needs to check to see if the user has administer (or manager?) roles (c_base_roles::MANAGER, c_base_roles::ADMINISTER) and if they do, set administrative to TRUE when calling do_load().
+ $user = $this->session->get_user_current();
+ $roles_current = $user->get_roles()->get_value_exact();
+
+ $id_user = NULL;
+ $arguments = $this->pr_get_path_arguments(static::PATH_SELF);
+ if (!empty($arguments)) {
+ $arguments_total = count($arguments);
+ $argument = reset($arguments);
+
+ if (is_numeric($argument)) {
+ $id_user = (int) $argument;
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+
+ // @todo: check to see if user id is valid and accessible.
+ // If the current viewer cannot access the user, then deny access to this page as appropriate.
+ }
+ else {
+ unset($arguments_total);
+ unset($argument);
+ unset($id_user);
+ unset($user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+
+ if ($arguments_total > 1) {
+ $argument = next($arguments);
+
+ if ($argument == 'print') {
+ // @todo: execute custom print function and then return.
+ $id_user = NULL;
+ }
+ #elseif ($argument == 'pdf') {
+ # // @todo: execute custom pdf function and then return.
+ # $id_user = NULL;
+ #}
+ #elseif ($argument == 'ps') {
+ # // @todo: execute custom postscript function and then return.
+ # $id_user = NULL;
+ #}
+ else {
+ $id_user = FALSE;
+ }
+ }
+ unset($arguments_total);
+ unset($argument);
+
+ if ($id_user === FALSE) {
+ unset($user);
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+ }
+
+ $user = NULL;
+ if (is_null($id_user)) {
+ $user = $this->session->get_user_current();
+ $id_user = $user->get_id()->get_value_exact();
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+ }
+ else {
+ $user = new c_standard_users_user();
+
+ // @todo: handle database errors.
+ $loaded = $user->do_load($this->database, $id_user);
+ if ($loaded instanceof c_base_return_false) {
+ $id_user = FALSE;
+ }
+ unset($loaded);
+ }
+
+ if ($id_user === FALSE) {
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+
+ return $executed;
+ }
+ unset($arguments);
+ unset($id_user);
+
$wrapper = $this->pr_create_tag_section(array(1 => 0));
// initialize the content as HTML.
* Implementation of pr_build_breadcrumbs().
*/
protected function pr_build_breadcrumbs() {
- $result = parent::pr_build_breadcrumbs();
- if ($result instanceof c_base_return_false) {
+ $path_user_view = new c_standard_path_user_view();
+ $path_user_view->set_parameters($this->http, $this->database, $this->session, $this->settings);
+ $path_user_view->set_path_tree($this->get_path_tree($this->path_tree));
+ $this->breadcrumbs = $path_user_view->get_breadcrumbs();
+ unset($path_user_view);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
unset($result);
- return new c_base_return_false();
}
- unset($result);
if (!($this->breadcrumbs instanceof c_base_menu_item)) {
$this->breadcrumbs = new c_base_menu_item();
}
- $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), static::PATH_SELF);
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
$this->breadcrumbs->set_item($item);
unset($item);
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
/**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
* Implements pr_get_text().
*/
protected function pr_get_text($code, $arguments = array()) {
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides path handler for the user session actions.
+ *
+ * This is generally intended to be used to trigger one or more session actions against a user account or related data.
+ * This could be a simple reaction as is common with ajax but could also be a page containing forms.
+ */
+
+require_once('common/base/classes/base_error.php');
+require_once('common/base/classes/base_return.php');
+require_once('common/base/classes/base_path.php');
+
+require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
+require_once('common/standard/paths/u/user_view.php');
+
+require_once('common/theme/classes/theme_html.php');
+
+/**
+ * Provides a path handler for user creation.
+ *
+ * This listens on: /u/session
+ */
+class c_standard_path_user_session extends c_standard_path_user {
+ public const PATH_SELF = 'u/session';
+
+ /**
+ * Implements do_execute().
+ */
+ public function do_execute(&$http, &$database, &$session, $settings = array()) {
+ // the parent function performs validation on the parameters.
+ $executed = parent::do_execute($http, $database, $session, $settings);
+ if (c_base_return::s_has_error($executed)) {
+ return $executed;
+ }
+
+ // @todo: this function needs to check to see if the user has administer (or manager?) roles (c_base_roles::MANAGER, c_base_roles::ADMINISTER) and if they do, set administrative to TRUE when calling do_load().
+ $user = $this->session->get_user_current();
+ $roles_current = $user->get_roles()->get_value_exact();
+
+ $id_user = NULL;
+ $arguments = $this->pr_get_path_arguments(static::PATH_SELF);
+ if (!empty($arguments)) {
+ $arguments_total = count($arguments);
+ $argument = reset($arguments);
+
+ if (is_numeric($argument)) {
+ $id_user = (int) $argument;
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+
+ // @todo: check to see if user id is valid and accessible.
+ // If the current viewer cannot access the user, then deny access to this page as appropriate.
+ }
+ else {
+ unset($arguments_total);
+ unset($argument);
+ unset($id_user);
+ unset($user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+
+ if ($arguments_total > 1) {
+ $argument = next($arguments);
+
+ if ($argument == 'print') {
+ // @todo: execute custom print function and then return.
+ $id_user = NULL;
+ }
+ #elseif ($argument == 'pdf') {
+ # // @todo: execute custom pdf function and then return.
+ # $id_user = NULL;
+ #}
+ #elseif ($argument == 'ps') {
+ # // @todo: execute custom postscript function and then return.
+ # $id_user = NULL;
+ #}
+ else {
+ $id_user = FALSE;
+ }
+ }
+ unset($arguments_total);
+ unset($argument);
+
+ if ($id_user === FALSE) {
+ unset($user);
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+ }
+
+ $user = NULL;
+ if (is_null($id_user)) {
+ $user = $this->session->get_user_current();
+ $id_user = $user->get_id()->get_value_exact();
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+ }
+ else {
+ $user = new c_standard_users_user();
+
+ // @todo: handle database errors.
+ $loaded = $user->do_load($this->database, $id_user);
+ if ($loaded instanceof c_base_return_false) {
+ $id_user = FALSE;
+ }
+ unset($loaded);
+ }
+
+ if ($id_user === FALSE) {
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+
+ return $executed;
+ }
+ unset($arguments);
+ unset($id_user);
+
+ // @todo: json responses are expected to be returned for ajax purposes.
+ // this will very likely support u/session/(ajax_action_name) such as u/session/ping for keeping the session and therefore session cookie alive.
+
+ return $executed;
+ }
+
+ /**
+ * Implements pr_get_text_title().
+ */
+ protected function pr_get_text_title($arguments = array()) {
+ return '';
+ }
+
+ /**
+ * Implements pr_get_text().
+ */
+ protected function pr_get_text($code, $arguments = array()) {
+ return '';
+ }
+}
require_once('common/base/classes/base_database.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
+require_once('common/standard/paths/u/user_view.php');
require_once('common/theme/classes/theme_html.php');
*
* This listens on: /u/settings
*/
-class c_standard_path_user_settings extends c_standard_path {
- protected const PATH_SELF = 'u/settings';
-
- protected const ID_USER_MINIMUM = 1000;
+class c_standard_path_user_settings extends c_standard_path_user {
+ public const PATH_SELF = 'u/settings';
+ protected const NAME_MENU_CONTENT = 'menu_content_user_view';
+ protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
protected const CLASS_USER_SETTINGS_ACCOUNT = 'user_settings-account';
protected const CLASS_USER_SETTINGS_PERSONAL = 'user_settings-personal';
protected const CLASS_USER_SETTINGS_ACCESS = 'user_settings-access';
protected const CLASS_USER_SETTINGS_HISTORY = 'user_settings-history';
- protected const CLASS_ID_USER = 'id-user';
- protected const CLASS_ID_USER_EXTERNAL = 'id-user-external';
-
/**
* Implements do_execute().
*/
if ($id_user < static::ID_USER_MINIMUM) {
$id_user = FALSE;
}
+
+ // @todo: check to see if user id is valid and accessible.
+ // If the current viewer cannot access the user, then deny access to this page as appropriate.
}
else {
unset($arguments_total);
* Implementation of pr_build_breadcrumbs().
*/
protected function pr_build_breadcrumbs() {
- $result = parent::pr_build_breadcrumbs();
- if ($result instanceof c_base_return_false) {
+ $path_user_view = new c_standard_path_user_view();
+ $path_user_view->set_parameters($this->http, $this->database, $this->session, $this->settings);
+ $path_user_view->set_path_tree($this->get_path_tree($this->path_tree));
+ $this->breadcrumbs = $path_user_view->get_breadcrumbs();
+ unset($path_user_view);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
unset($result);
- return new c_base_return_false();
}
- unset($result);
if (!($this->breadcrumbs instanceof c_base_menu_item)) {
$this->breadcrumbs = new c_base_menu_item();
}
- $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), static::PATH_SELF);
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
$this->breadcrumbs->set_item($item);
unset($item);
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
/**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
* Implements pr_get_text().
*/
protected function pr_get_text($code, $arguments = array()) {
require_once('common/base/classes/base_path.php');
require_once('common/standard/classes/standard_path.php');
+require_once('common/standard/classes/standard_path_user.php');
+require_once('common/standard/paths/u/user_view.php');
require_once('common/theme/classes/theme_html.php');
*
* This listens on: /u/unlock
*/
-class c_standard_path_user_unlock extends c_standard_path {
- protected const PATH_SELF = 'u/unlock';
+class c_standard_path_user_unlock extends c_standard_path_user {
+ public const PATH_SELF = 'u/unlock';
+
+ protected const NAME_MENU_CONTENT = 'menu_content_user_view';
+ protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
/**
* Implements do_execute().
return $executed;
}
- $wrapper = $this->pr_create_tag_section(array(1 => 0));
+ // @todo: this function needs to check to see if the user has administer (or manager?) roles (c_base_roles::MANAGER, c_base_roles::ADMINISTER) and if they do, set administrative to TRUE when calling do_load().
+ $user = $this->session->get_user_current();
+ $roles_current = $user->get_roles()->get_value_exact();
+
+ $id_user = NULL;
+ $arguments = $this->pr_get_path_arguments(static::PATH_SELF);
+ if (!empty($arguments)) {
+ $arguments_total = count($arguments);
+ $argument = reset($arguments);
+
+ if (is_numeric($argument)) {
+ $id_user = (int) $argument;
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+
+ // @todo: check to see if user id is valid and accessible.
+ // If the current viewer cannot access the user, then deny access to this page as appropriate.
+ }
+ else {
+ unset($arguments_total);
+ unset($argument);
+ unset($id_user);
+ unset($user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+
+ if ($arguments_total > 1) {
+ $argument = next($arguments);
+
+ if ($argument == 'print') {
+ // @todo: execute custom print function and then return.
+ $id_user = NULL;
+ }
+ #elseif ($argument == 'pdf') {
+ # // @todo: execute custom pdf function and then return.
+ # $id_user = NULL;
+ #}
+ #elseif ($argument == 'ps') {
+ # // @todo: execute custom postscript function and then return.
+ # $id_user = NULL;
+ #}
+ else {
+ $id_user = FALSE;
+ }
+ }
+ unset($arguments_total);
+ unset($argument);
+
+ if ($id_user === FALSE) {
+ unset($user);
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+ }
+
+ $user = NULL;
+ if (is_null($id_user)) {
+ $user = $this->session->get_user_current();
+ $id_user = $user->get_id()->get_value_exact();
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+ }
+ else {
+ $user = new c_standard_users_user();
+
+ // @todo: handle database errors.
+ $loaded = $user->do_load($this->database, $id_user);
+ if ($loaded instanceof c_base_return_false) {
+ $id_user = FALSE;
+ }
+ unset($loaded);
+ }
+
+ if ($id_user === FALSE) {
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+
+ return $executed;
+ }
+ unset($arguments);
+ unset($id_user);
+
+ $wrapper = $this->pr_create_tag_section(array(1 => 1000));
// initialize the content as HTML.
$this->pr_create_html();
* Implementation of pr_build_breadcrumbs().
*/
protected function pr_build_breadcrumbs() {
- $result = parent::pr_build_breadcrumbs();
- if ($result instanceof c_base_return_false) {
+ $path_user_view = new c_standard_path_user_view();
+ $path_user_view->set_parameters($this->http, $this->database, $this->session, $this->settings);
+ $path_user_view->set_path_tree($this->get_path_tree($this->path_tree));
+ $this->breadcrumbs = $path_user_view->get_breadcrumbs();
+ unset($path_user_view);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
unset($result);
- return new c_base_return_false();
}
- unset($result);
if (!($this->breadcrumbs instanceof c_base_menu_item)) {
$this->breadcrumbs = new c_base_menu_item();
}
- $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), static::PATH_SELF);
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
$this->breadcrumbs->set_item($item);
unset($item);
protected function pr_create_html_add_header_link_canonical() {
$tag = c_theme_html::s_create_tag(c_base_markup_tag::TYPE_LINK);
$tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_REL, 'canonical');
- $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . static::PATH_SELF);
+ $tag->set_attribute(c_base_markup_attributes::ATTRIBUTE_HREF, $this->settings['base_scheme'] . '://' . $this->settings['base_host'] . $this->settings['base_port'] . $this->settings['base_path'] . self::PATH_SELF);
$this->html->set_header($tag);
unset($tag);
}
/**
- * Implements pr_get_text_title().
- */
- protected function pr_get_text_title($arguments = array()) {
- return $this->pr_get_text(0, $arguments);
- }
-
- /**
* Implements pr_get_text().
*/
protected function pr_get_text($code, $arguments = array()) {
require_once('common/base/classes/base_database.php');
require_once('common/standard/classes/standard_path.php');
-require_once('common/standard/paths/u/user_settings.php');
+require_once('common/standard/classes/standard_path_user.php');
require_once('common/theme/classes/theme_html.php');
*
* This listens on: /u/view
*/
-class c_standard_path_user_view extends c_standard_path_user_settings {
- protected const PATH_SELF = 'u/view';
+class c_standard_path_user_view extends c_standard_path_user {
+ public const PATH_SELF = 'u/view';
+
+ protected const NAME_MENU_CONTENT = 'menu_content_user_view';
+ protected const HANDLER_MENU_CONTENT = 'c_standard_menu_content_user_view';
+
+ /**
+ * Implements do_execute().
+ */
+ public function do_execute(&$http, &$database, &$session, $settings = array()) {
+ // the parent function performs validation on the parameters.
+ $executed = parent::do_execute($http, $database, $session, $settings);
+ if (c_base_return::s_has_error($executed)) {
+ return $executed;
+ }
+
+ // @todo: this function needs to check to see if the user has administer (or manager?) roles (c_base_roles::MANAGER, c_base_roles::ADMINISTER) and if they do, set administrative to TRUE when calling do_load().
+ $user = $this->session->get_user_current();
+ $roles_current = $user->get_roles()->get_value_exact();
+
+ $id_user = NULL;
+ $arguments = $this->pr_get_path_arguments(static::PATH_SELF);
+ if (!empty($arguments)) {
+ $arguments_total = count($arguments);
+ $argument = reset($arguments);
+
+ if (is_numeric($argument)) {
+ $id_user = (int) $argument;
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+
+ // @todo: check to see if user id is valid and accessible.
+ // If the current viewer cannot access the user, then deny access to this page as appropriate.
+ }
+ else {
+ unset($arguments_total);
+ unset($argument);
+ unset($id_user);
+ unset($user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+
+ if ($arguments_total > 1) {
+ $argument = next($arguments);
+
+ if ($argument == 'print') {
+ // @todo: execute custom print function and then return.
+ $id_user = NULL;
+ }
+ #elseif ($argument == 'pdf') {
+ # // @todo: execute custom pdf function and then return.
+ # $id_user = NULL;
+ #}
+ #elseif ($argument == 'ps') {
+ # // @todo: execute custom postscript function and then return.
+ # $id_user = NULL;
+ #}
+ else {
+ $id_user = FALSE;
+ }
+ }
+ unset($arguments_total);
+ unset($argument);
+
+ if ($id_user === FALSE) {
+ unset($user);
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+ unset($arguments);
+
+ return $executed;
+ }
+ }
+
+ $user = NULL;
+ if (is_null($id_user)) {
+ $user = $this->session->get_user_current();
+ $id_user = $user->get_id()->get_value_exact();
+
+ // do not allow view access to reserved/special accounts.
+ if ($id_user < static::ID_USER_MINIMUM) {
+ $id_user = FALSE;
+ }
+ }
+ else {
+ $user = new c_standard_users_user();
+
+ // @todo: handle database errors.
+ $loaded = $user->do_load($this->database, $id_user);
+ if ($loaded instanceof c_base_return_false) {
+ $id_user = FALSE;
+ }
+ unset($loaded);
+ }
+
+ if ($id_user === FALSE) {
+ unset($id_user);
+
+ $error = c_base_error::s_log(NULL, array('arguments' => array(':{path_name}' => static::PATH_SELF . '/' . implode('/', $arguments), ':{function_name}' => __CLASS__ . '->' . __FUNCTION__)), i_base_error_messages::NOT_FOUND_PATH);
+ $executed->set_error($error);
+
+ unset($error);
+
+ return $executed;
+ }
+ unset($arguments);
+ unset($id_user);
+
+ $wrapper = $this->pr_create_tag_section(array(1 => 0));
+
+ // initialize the content as HTML.
+ $this->pr_create_html();
+ $this->html->set_tag($wrapper);
+ unset($wrapper);
+
+ $this->pr_add_menus();
+
+ $executed->set_output($this->html);
+ unset($this->html);
+
+ return $executed;
+ }
+
+ /**
+ * Implementation of pr_build_breadcrumbs().
+ */
+ protected function pr_build_breadcrumbs() {
+ $result = parent::pr_build_breadcrumbs();
+ if ($result instanceof c_base_return_false) {
+ unset($result);
+ return new c_base_return_false();
+ }
+ unset($result);
+
+ if (!($this->breadcrumbs instanceof c_base_menu_item)) {
+ $this->breadcrumbs = new c_base_menu_item();
+ }
+
+ $item = $this->pr_create_breadcrumbs_item($this->pr_get_text(0), self::PATH_SELF);
+ $this->breadcrumbs->set_item($item);
+ unset($item);
+
+ return new c_base_return_true();
+ }
/**
* Implements pr_get_text().
$string = 'View User';
}
break;
- default:
- // otherwise
- return parent::pr_get_text($code, $arguments);
}
if (!empty($arguments)) {
date_locked timestamp with time zone,
date_deleted timestamp with time zone,
+ image_original bytea,
+ image_cropped bytea,
+ image_icon bytea,
+
settings json,
constraint cp_users primary key (id),
create index i_users_id_sort_y on s_tables.t_users (id_sort) with (fillfactor = 100) where id_sort = 121;
create index i_users_id_sort_z on s_tables.t_users (id_sort) with (fillfactor = 100) where id_sort = 122;
-
-
/*** provide current user access to their own information (system users are not allowed to update their account) ***/
create view s_users.v_users_self with (security_barrier=true) as
- select id, id_external, id_sort, name_machine, name_human, address_email, is_administer, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_system, is_public, is_locked, is_private, is_deleted, is_roler, date_created, date_changed, date_synced, date_locked, null::timestamp as date_deleted, settings from s_tables.t_users
+ select id, id_external, id_sort, name_machine, name_human, address_email, is_administer, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_system, is_public, is_locked, is_private, is_deleted, is_roler, date_created, date_changed, date_synced, date_locked, null::timestamp as date_deleted, image_original, image_cropped, image_icon, settings from s_tables.t_users
where not is_deleted and (name_machine)::text = (current_user)::text;
create view public.v_users_self_session with (security_barrier=true) as
- select id, id_external, id_sort, name_machine, name_human, address_email, is_administer, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_system, is_public, is_locked, is_private, is_deleted, is_roler, date_created, date_changed, date_synced, date_locked, null::timestamp as date_deleted, settings from s_tables.t_users
+ select id, id_external, id_sort, name_machine, name_human, address_email, is_administer, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_system, is_public, is_locked, is_private, is_deleted, is_roler, date_created, date_changed, date_synced, date_locked, null::timestamp as date_deleted, image_original, image_cropped, image_icon, settings from s_tables.t_users
where not is_deleted and (name_machine)::text = (session_user)::text;
create view public.v_users_self_locked_not with (security_barrier=true) as
- select id, id_external, id_sort, name_machine, name_human, address_email, is_administer, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_system, is_public, is_locked, is_private, is_deleted, is_roler, date_created, date_changed, date_synced, date_locked, null::timestamp as date_deleted, settings from s_tables.t_users
+ select id, id_external, id_sort, name_machine, name_human, address_email, is_administer, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_system, is_public, is_locked, is_private, is_deleted, is_roler, date_created, date_changed, date_synced, date_locked, null::timestamp as date_deleted, image_original, image_cropped, image_icon, settings from s_tables.t_users
where not is_deleted and not is_locked and (name_machine)::text = (current_user)::text;
create view public.v_users_self_exists with (security_barrier=true) as
- select id, name_machine, is_system, is_public, is_locked, is_deleted from s_tables.t_users
+ select id, name_machine, is_system, is_public, is_locked, is_deleted, image_original, image_cropped, image_icon from s_tables.t_users
where (name_machine)::text = (current_user)::text;
create view s_users.v_users_self_insert with (security_barrier=true) as
- select id_external, name_human, address_email, is_private, settings from s_tables.t_users
+ select id_external, name_human, address_email, is_private, image_original, image_cropped, image_icon, settings from s_tables.t_users
where not is_deleted and not is_locked and not is_system and not is_public and (name_machine)::text = (current_user)::text
with check option;
create view s_users.v_users_self_update with (security_barrier=true) as
- select address_email, is_private, settings from s_tables.t_users
+ select address_email, is_private, image_original, image_cropped, image_icon, settings from s_tables.t_users
where not is_deleted and not is_locked and not is_system and not is_public and (name_machine)::text = (current_user)::text
with check option;
/**** anonymous user has uid = 1 ****/
create view public.v_users_self with (security_barrier=true) as
- select id, id_external, id_sort, name_machine, name_human, address_email, is_administer, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_system, is_public, is_locked, is_private, is_deleted, is_roler, date_created, date_changed, date_synced, date_locked, null::timestamp as date_deleted, settings from s_tables.t_users
+ select id, id_external, id_sort, name_machine, name_human, address_email, is_administer, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_system, is_public, is_locked, is_private, is_deleted, is_roler, date_created, date_changed, date_synced, date_locked, null::timestamp as date_deleted, image_original, image_cropped, image_icon, settings from s_tables.t_users
where not is_deleted and id = 1;
/*** provide public user information ***/
create view public.v_users with (security_barrier=true) as
- select id, null::bigint as id_external, id_sort, name_machine, name_human, null::public.ct_email as address_email, null::bool as is_administer, null::bool as is_manager, null::bool as is_auditor, null::bool as is_publisher, null::bool as is_insurer, null::bool as is_financer, null::bool as is_reviewer, null::bool as is_editor, null::bool as is_drafter, null::bool as is_requester, is_system, is_public, null::bool as is_locked, is_private, is_deleted, null::bool as is_roler, null::timestamp as date_created, null::timestamp as date_changed, null::timestamp as date_synced, null::timestamp as date_locked, null::timestamp as date_deleted, null::json as settings from s_tables.t_users
+ select id, null::bigint as id_external, id_sort, name_machine, name_human, null::public.ct_email as address_email, null::bool as is_administer, null::bool as is_manager, null::bool as is_auditor, null::bool as is_publisher, null::bool as is_insurer, null::bool as is_financer, null::bool as is_reviewer, null::bool as is_editor, null::bool as is_drafter, null::bool as is_requester, is_system, is_public, null::bool as is_locked, is_private, is_deleted, null::bool as is_roler, null::timestamp as date_created, null::timestamp as date_changed, null::timestamp as date_synced, null::timestamp as date_locked, null::timestamp as date_deleted, image_original, image_cropped, image_icon, null::json as settings from s_tables.t_users
where (not is_deleted and not is_private) or (not is_deleted and (name_machine)::text = (current_user)::text);
/*** provide e-mail address as public information only if it is explicitly allowed ***/
create view public.v_users_email with (security_barrier=true) as
- select id, null::bigint as id_external, id_sort, name_machine, name_human, address_email, null::bool as is_administer, null::bool as is_manager, null::bool as is_auditor, null::bool as is_publisher, null::bool as is_insurer, null::bool as is_financer, null::bool as is_reviewer, null::bool as is_editor, null::bool as is_drafter, null::bool as is_requester, is_system, is_public, null::bool as is_locked, is_private, is_deleted, null::bool as is_roler, null::timestamp as date_created, null::timestamp as date_changed, null::timestamp as date_synced, null::timestamp as date_locked, null::timestamp as date_deleted, null::json as settings from s_tables.t_users
+ select id, null::bigint as id_external, id_sort, name_machine, name_human, address_email, null::bool as is_administer, null::bool as is_manager, null::bool as is_auditor, null::bool as is_publisher, null::bool as is_insurer, null::bool as is_financer, null::bool as is_reviewer, null::bool as is_editor, null::bool as is_drafter, null::bool as is_requester, is_system, is_public, null::bool as is_locked, is_private, is_deleted, null::bool as is_roler, null::timestamp as date_created, null::timestamp as date_changed, null::timestamp as date_synced, null::timestamp as date_locked, null::timestamp as date_deleted, image_original, image_cropped, image_icon, null::json as settings from s_tables.t_users
where (not is_deleted and not is_private and not (address_email).private) or (not is_deleted and (name_machine)::text = (current_user)::text);
where not is_deleted;
create view s_managers.v_users_insert with (security_barrier=true) as
- select id, id_external, name_machine, name_human, address_email, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_locked, is_private, is_roler, settings from s_tables.t_users
+ select id, id_external, name_machine, name_human, address_email, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_locked, is_private, is_roler, image_original, image_cropped, image_icon, settings from s_tables.t_users
with check option;
create view s_managers.v_users_update with (security_barrier=true) as
- select id, id_external, name_machine, name_human, address_email, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_locked, is_private, is_roler, settings from s_tables.t_users
+ select id, id_external, name_machine, name_human, address_email, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_locked, is_private, is_roler, image_original, image_cropped, image_icon, settings from s_tables.t_users
where not is_deleted
with check option;
create view s_managers.v_users_deleted with (security_barrier=true) as
- select id, id_external, name_machine, name_human, address_email, is_administer, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_locked, is_private, is_roler, date_created, date_changed, date_synced, date_locked, settings from s_tables.t_users
+ select id, id_external, name_machine, name_human, address_email, is_administer, is_manager, is_auditor, is_publisher, is_insurer, is_financer, is_reviewer, is_editor, is_drafter, is_requester, is_locked, is_private, is_roler, date_created, date_changed, date_synced, date_locked, image_original, image_cropped, image_icon, settings from s_tables.t_users
where is_deleted;