ACCENT
public
mixed
ACCENT
= $CurrentUser->session['Skin_accent']
public
mixed
ACCENT
= $CurrentUser->session['Skin_accent']
Determines if localhost calls could be passed.
public
mixed
ALLOW_LOCALHOST
= \false
If true, any call from localhost is valid. Otherwise, normal security rules are applied.
public
mixed
Auth_OpenID_RAND_SOURCE
= null
public
mixed
BUFFER_SIZE
= 4096
public
mixed
CACHE_DIR
= \Keruald\OmniTools\OS\Environment::getOr('CACHE_DIR', 'cache')
public
mixed
CONTENT_DIR
= \Keruald\OmniTools\OS\Environment::getOr('CONTENT_DIR', 'content')
public
mixed
CONTENT_USERS_DIR
= \Keruald\OmniTools\OS\Environment::getOr('CONTENT_USERS_DIR', \CONTENT_DIR . '/users')
This constant indicates we need to load the Dijit (and so Dojo) library.
public
mixed
DIJIT
= \true
public
mixed
DIJIT
= \true
public
mixed
DIJIT
= \true
Determines if the dojo library have or not been loaded
public
mixed
DOJO
= \defined('DIJIT')
If true, there's a code like <script src="js/dojo/dojo/dojo.js"><script> in the
block of the code.
public
mixed
DOJO
= \true
Determines if the error must be formatted.
public
mixed
FORMAT_ERROR
= \false
If true, any error will be sent to api_output ; otherwise, it will be printed as is.
GENERAL_ERROR is the constant meaning the error is general, ie not covered by another more specific error constant.
public
mixed
GENERAL_ERROR
= 117
HACK_ERROR is the constant meaning access is non authorized to the resource.
public
mixed
HACK_ERROR
= 99
It encompasses two problematics: the URL points to a resource belonging to another user or for the current user have no access right (for malformed URL, pick instead GENERAL_ERROR) ; the user is anonymous, instead to be logged in.
A suggested way to handle the second problematic is to store in hidden input fields or better in the session the previous form data, and to print a login form.
If you implement this, you don't even need to distinguish between the two cases, as once logged in, the regular HACK_ERROR could also be printed.
This constant indicates the header have been printed
public
mixed
HEADER_PRINTED
= \true
public
mixed
LANG
= $_SESSION['lang']
Determines if error should be printed.
public
mixed
OUTPUT_ERROR
= \true
If true, the error will be printed according the FORMAT_ERROR setting. Otherwise, a blank page will be served.
Magic number which indicates the user is logged in, but haven't selected its perso.
public
mixed
PERSO_NOT_SELECTED
= -7
public
mixed
PersoSelected
= true
public
mixed
PHOTOS_DIR
= \CONTENT_DIR . "/users/_photos"
public
mixed
PHOTOS_URL
= $Config['StaticContentURL'] . '/content/users/_photos'
public
mixed
SCENE_DIR
= \CONTENT_DIR . "/scenes"
The directory containing scenes files
public
mixed
SCENE_DIR
= 'content/scenes'
public
mixed
SCENE_URL
= $Config['StaticContentURL'] . '/content/scenes'
SQL_ERROR is the constant meaning the error is a SQL error.
public
mixed
SQL_ERROR
= 65
As a message_die function parameter, it allows to add SQL specific debug information.
public
mixed
STDERR
= -1
public
mixed
STDOUT
= 1
public
mixed
STORIES_DIR
= \CONTENT_DIR . "/stories"
The table where are located the API keys
public
mixed
TABLE_API_KEYS
= 'api_keys'
public
mixed
TABLE_API_KEYS
= $prefix . 'api_keys'
public
mixed
TABLE_BODIES
= $prefix . 'geo_bodies'
public
mixed
TABLE_COMMENTS
= $prefix . 'comments'
public
mixed
TABLE_CONTENT_FILES
= $prefix . 'content_files'
public
mixed
TABLE_CONTENT_LOCATIONS
= $prefix . 'content_locations'
public
mixed
TABLE_CONTENT_ZONES
= $prefix . 'content_zones'
public
mixed
TABLE_CONTENT_ZONES_LOCATIONS
= $prefix . 'content_zones_locations'
public
mixed
TABLE_LOCATIONS
= $prefix . 'geo_locations'
public
mixed
TABLE_LOG
= $prefix . 'log'
public
mixed
TABLE_LOG_SMARTLINE
= $prefix . 'log_smartline'
public
mixed
TABLE_MESSAGES
= $prefix . 'messages'
public
mixed
TABLE_MOTD
= $prefix . 'motd'
public
mixed
TABLE_PAGES
= $prefix . 'pages'
public
mixed
TABLE_PAGES_EDITS
= $prefix . 'pages_edits'
public
mixed
TABLE_PERSOS
= $prefix . 'persos'
public
mixed
TABLE_PERSOS_FLAGS
= $prefix . 'persos_flags'
public
mixed
TABLE_PERSOS_NOTES
= $prefix . 'persos_notes'
public
mixed
TABLE_PLACES
= $prefix . 'geo_places'
public
mixed
TABLE_PORTS
= $prefix . 'ports'
public
mixed
TABLE_PROFILES
= $prefix . 'profiles'
public
mixed
TABLE_PROFILES_COMMENTS
= $prefix . 'profiles_comments'
public
mixed
TABLE_PROFILES_PHOTOS
= $prefix . 'profiles_photos'
public
mixed
TABLE_PROFILES_TAGS
= $prefix . 'profiles_tags'
public
mixed
TABLE_REGISTRY
= $prefix . 'registry'
public
mixed
TABLE_REQUESTS
= $prefix . 'requests'
public
mixed
TABLE_REQUESTS_REPLIES
= $prefix . 'requests_replies'
public
mixed
TABLE_SESSIONS
= $prefix . 'sessions'
public
mixed
TABLE_SHIPS
= $prefix . 'ships'
public
mixed
TABLE_USERS
= $prefix . 'users'
public
mixed
TABLE_USERS_AUTH
= $prefix . 'users_auth'
public
mixed
TABLE_USERS_INVITES
= $prefix . 'users_invites'
public
mixed
THEME
= $CurrentUser->session['Skin']
public
mixed
URL
= 'http://' . $_SERVER['HTTP_HOST'] . '/index.php'
Magic number which indicates the user is not logged in.
public
mixed
USER_NOT_LOGGED
= -9
Determines if a specified location is buildable
is_buildable(Location $location[, mixed &$error = '' ]) : bool
the location to check
true if the location is buildable ; otherwise, false
Gets request allow URL
get_request_allow_url(PersoRequest $request) : string
the perso request to confirm
the URL to allow the request
Gets request deny URL
get_request_deny_url(PersoRequest $request) : string
the perso request to confirm
the URL to deny the request
Gets request URL
get_request_url(mixed $requestFlag, string $store, string $key, string $value) : the
'perso' or 'registry'
the perso flag or registry key
the value to store
request URL
Gets section to print to the user
get_section(mixed $story) : StorySection
the section, or null if not found
Smarty romanize modifier plugin
smarty_modifier_romanize(mixed $number) : string
Type: modifier
Name: romanize
Purpose: prints a number in roman
Smarty sector modifier plugin
smarty_modifier_sector(Location $location) : string
Type: modifier
Name: sector
Purpose: prints the sector from a location
Smarty text to HTML modifier plugin
smarty_modifier_text2html(string $string) : string
Type: modifier
Name: text2html
Purpose: HTML representation for Azhà r profiles
Smarty lower modifier plugin
smarty_modifier_yyyymmdd(string $string) : string
Type: modifier
Name: yyyymmdd
Purpose: Appends dashes to yyyymmdd string to output yyyy-mm-dd
The main function for converting to an XML document.
toXml(mixed $data[, string $rootNodeName = 'data' ][, SimpleXMLElement $xml = null ][, string $unknownNodeName = 'unknownNode' ]) : string
Pass in a multidimensional array and this recursively loops through and builds up an XML document.
What you want the root node to be — defaults to data.
Should only be used recursively
Name to give to unknown (numeric) keys
XML
Outputs API reply, printing it in the specified format.
api_output(mixed $reply, string $xmlRoot[, string $xmlChildren = "item" ]) : mixed
The format will be read form $_REQUEST['format'].
the reply to format
the XML root element name (optional, default value is 'data').
the XML children elements name (optional, will be deducted from the context if omitted, or, if not possible, will be unknownNode)
Checks if credentials are okay and exits if not
cerbere() : mixed
If the credentials aren't valid, it will print an error message if OUTPUT_ERROR is defined and true.
This error message will be formatted through the api_output function if FORMAT_ERROR is defined and true ; otherwise, it will be print as is.
To help debug, you can also define ALLOW_LOCALHOST. If this constant is defined and true, any call from localhost will be accepted, without checking the key.
Prints a message in raw or API format, then exits.
cerbere_die(string $message) : never
The error message will be formatted through api_output if the constant FORMAT_ERROR is defined and true. Otherwise, it will be printed as is.
The error message to print
loadEnvironment() : mixed
Gets the nickname from the specified perso ID
get_name(int $perso_id) : string
The specified perso ID
The perso's nickname
Gets the user ID from the specified username
get_userid(string $username) : int
The username
the user ID
Gets an information from the application global registry
registry_get(DatabaseEngine $db, string $key) : string
Sets an information in the application global registry
registry_set(DatabaseEngine $db, string $key, string $value) : void
the registry key
the value to store at the specified registry key
Returns "s" when the $amount request a plural This function is a French plural helper.
s(int $amount) : string
's' if $amount implies a plural ; '' if it implies a singular.
Returns "x" when the $amount request a plural This function is a French plural helper.
x(int $amount) : string
'x' if $amount implies a plural ; '' if it implies a singular.
Prints human-readable information about a variable.
dprint_r(mixed $expression) : mixed
It behaves like the print_r command, but the output is enclosed in pre tags, to have a preformatted HTML output.
The expression to be printed
Generates a GUID, or more precisely an UUID
new_guid() : string
the UUID
Determines if the expression is a valid UUID (a guid without {}).
is_guid(string $expression) : bool
the expression to check
true if the specified expression is a valid UUID ; otherwise, false.
Gets file extension
get_extension(string $file) : string
the file to get the extension
the extension from the specified file
Inserts a message into the supralog
supralog(string $category, string $message[, string|null $source = null ]) : mixed
the entry category
the message to log
the entry source.
Defines the LANG constant, to lang to print
initialize_lang() : void
This information is contained in the session, or if not yet defined, it's to determine according the user's browser preferences.
Gets a common lang spoken by the site and the user's browser
find_lang([string|null $fallback = null ]) : string
The language when no common language is found
The language to use
Gets the languages accepted by the browser, by order of priority.
get_http_accept_languages() : array<string|int, string>
This will read the HTTP_ACCEPT_LANGUAGE variable sent by the browser in the HTTP request.
list of the languages accepted by browser
Loads specified language Smarty configuration file
lang_load(string $file[, mixed|null $sections = null ]) : void
the file to load
array of section names, single section or null
Gets a specified language expression defined in configuration file
lang_get(string $key) : string
the configuration key matching the value to get
The value in the configuration file
Converts a YYYYMMDD or YYYY-MM-DD timestamp to unixtime
to_unixtime(string $timestamp) : int
the timestamp to convert
the unixtime
Converts a unixtime to the YYYYMMDD or YYYY-MM-DD timestamp format
to_timestamp([int $unixtime = null ][, int $format = 8 ]) : string
the time to convert
8 or 10. If 8 (default), will output YYYYMMDD. If 10, YYYY-MM-DD.
the timestamp
Converts a unixtime to the Hypership time format or gets the current hypership time.
get_hypership_time([int $unixtime = null ]) : string
The unixtime to convert to HyperShip time. If omitted, the current unixtime.
The HyperShip time
Gets the URL matching the specified resource.
get_url() : string
Example:
$url = get_url('ship', $ship);
echo $url; //if $ship contains S00001, this should print /ship/S00001
the URL matching the specified resource
Gets the current page URL
get_page_url() : string
the current page URL
Gets the server URL
get_server_url() : string
the server URL
Gets $_SERVER['PATH_INFO'] or computes the equivalent if not defined.
get_current_url() : string
This function allows the entry point controllers to get the current URL in a consistent way, for any redirection configuration
So with /foo/bar, /index.php/foo/bar, /zed/index.php/foo/bar or /zed/foo/bar get_current_url will return /foo/bar
the relevant URL part
Gets an array of url fragments to be processed by controller
get_current_url_fragments() : array<string|int, mixed>
an array of string, one for each URL fragment
Gets an hash value to check the integrity of URLs in /do.php calls
get_xhr_hash(array<string|int, mixed> $args) : string
the args to compute the hash
the hash parameter for your xmlHttpRequest url
Gets the URL to call do.php, the xmlHttpRequest controller
get_xhr_hashed_url() : string
the xmlHttpRequest url, with an integrity hash
Gets the URL to call do.php, the xmlHttpRequest controller
get_xhr_url() : string
the xmlHttpRequest url
Output a general error, with human-readable information about the specified expression as error message ; terminates the current script.
dieprint_r(mixed $expression[, string $title = '' ]) : never
the expression to be printed
the message title (optional, default will be 'Debug')
Outputs an error message and terminates the current script.
message_die(int $msg_code[, string $msg_text = '' ][, string $msg_title = '' ][, string $err_line = '' ][, mixed $err_file = '' ][, string $sql = '' ]) : never
Error will be output through Smarty one of the following templates : error_block.tpl if the header have already been printed ; error.tpl if the error occurred before the header were called and printed.
If smarty couldn't be loaded, old_message_die method will be called, which produces a table output.
an integer constant identifying the error (HACK_ERROR, SQL_ERROR, GENERAL_ERROR)
the error message text (optional, but recommended)
the error message title (optional)
the path of file where the error occurred (optional, suggested value is FILE)
the SQL query (optional, used only if msg_code is SQL_ERROR)
Outputs an error message and terminates the current script.
old_message_die(int $msg_code[, string $msg_text = '' ][, string $msg_title = '' ][, string $err_line = '' ][, mixed $err_file = '' ][, string $sql = '' ]) : never
This is the message_die method from Espace Win, used on Zed as fallback if Smarty isn't initialized yet. Former "german style" error HTML markups have been removed.
an integer constant identifying the error (HACK_ERROR, SQL_ERROR, GENERAL_ERROR)
the error message text (optional, but recommended)
the error message title (optional)
the path of file where the error occurred (optional, suggested value is FILE)
the SQL query (optional, used only if msg_code is SQL_ERROR)
Gets an Auth_OpenID_Consumer instance
get_openid_consumer() : Auth_OpenID_Consumer
the instance
Logs in the user if the OpenID is recognized.
openid_login(string $url) : mixed
Otherwise, sets an error message.
The OpenID URL
session_update() : mixed
nbc() : mixed
get_info(mixed $info) : mixed
get_logged_user() : mixed
set_info(mixed $info, mixed $value) : mixed
Destroys $_SESSION array values, help ID
clean_session() : mixed
Logs in user
login(mixed $user_id, mixed $username) : mixed
Logs out user
logout() : mixed
Error handler called during SmartLine command execution.
SmartLineHandler(int $level, string $error, string $file, int $line) : mixed
Any error occurring during command execution will be set in STDERR.
To get an array with all the errors:
$errors = $yourSmartLine->gets_all(STDERR)
Or to prints all the error:
$yourSmartLine->prints_all(STDERR)
Or to pops (gets and deletes) only the last error:
$lastError = $yourSmartLine->gets(STDERR)
The PHP error level
The error description
The script where the error occurred
The line where the error occurred
Logs a Smartline command
log_C(string $command[, bool $isError = false ]) : mixed
the command to log
indicates if the command is an error