Commit 21d5712f authored by Aaron Wells's avatar Aaron Wells
Browse files

Removing end-of-line whitespace

As vetted in the May 2014 dev meeting
http://meetbot.mahara.org/mahara-dev/2014/mahara-dev.2014-05-01-08.01.log.html

Change-Id: I353ed74d69a5346fbe4e8e521e5c349dbe8dcbac
parent e46afb22
......@@ -15,7 +15,7 @@
*/
/**
* The contact information artefact is deliberatly skipped from leap export, as
* The contact information artefact is deliberatly skipped from leap export, as
* the information is duplicated from the profile anyway
*/
class LeapExportElementContactinformation extends LeapExportElement {
......@@ -25,7 +25,7 @@ class LeapExportElementContactinformation extends LeapExportElement {
}
/**
* The information in the personalinformation artefact is sent to the internal
* The information in the personalinformation artefact is sent to the internal
* export plugin to be exported as persondata
*/
class LeapExportElementPersonalinformation extends LeapExportElement {
......@@ -76,7 +76,7 @@ class LeapExportElementPersonalinformation extends LeapExportElement {
}
/**
* The simple WYSIWYG resume fields are exported as simple entries with html
* The simple WYSIWYG resume fields are exported as simple entries with html
* content
*/
class LeapExportElementResumeWysiwygField extends LeapExportElement {
......@@ -105,7 +105,7 @@ class LeapExportElementPersonalskill extends LeapExportElementResumeSkillField {
/**
* Base class for the composite artefacts. They consist of one or more
* entries per each artefact, and one entry to tie them all together in a
* entries per each artefact, and one entry to tie them all together in a
* grouping (which is what this class represents)
*/
class LeapExportElementResumeComposite extends LeapExportElement {
......@@ -194,7 +194,7 @@ class LeapExportElementEmploymenthistory extends LeapExportElementResumeComposit
/**
* Element to create pseudo-elements for composite children which aren't really
* Element to create pseudo-elements for composite children which aren't really
* artefacts in Mahara but do need to map to LEAP elements
*/
abstract class LeapExportElementResumeCompositeChild extends LeapExportElement {
......@@ -207,8 +207,8 @@ abstract class LeapExportElementResumeCompositeChild extends LeapExportElement {
$this->originalrecord = $child;
$this->entrydata = $this->record_to_entrydata($child);
$this->parentartefact = $parentartefact;
// We pass 'null' as the artefact ID, as this class represents
// composite children that aren't really artefacts. The field
// We pass 'null' as the artefact ID, as this class represents
// composite children that aren't really artefacts. The field
// 'parentartefact' holds a reference to the parent.
parent::__construct(null, $exporter);
$this->assign_smarty_vars();
......@@ -297,7 +297,7 @@ class LeapExportElementResumeCompositeChildMembership extends LeapExportElementR
}
/**
* Some of the resume composites need to be converted into more than one entry.
* Some of the resume composites need to be converted into more than one entry.
* This class represents such a composite.
*/
abstract class LeapExportElementResumeCompositeChildWithSiblings extends LeapExportElementResumeCompositeChild {
......
......@@ -69,11 +69,11 @@ $personalinformationform = pieform(array(
),
'placeofbirth' => array(
'type' => 'text',
'defaultvalue' => ((!empty($personalinformation))
'defaultvalue' => ((!empty($personalinformation))
? $personalinformation->get_composite('placeofbirth') : null),
'title' => get_string('placeofbirth', 'artefact.resume'),
'size' => 30,
),
),
'citizenship' => array(
'type' => 'text',
'defaultvalue' => ((!empty($personalinformation))
......@@ -82,7 +82,7 @@ $personalinformationform = pieform(array(
'size' => 30,
),
'visastatus' => array(
'type' => 'text',
'type' => 'text',
'defaultvalue' => ((!empty($personalinformation))
? $personalinformation->get_composite('visastatus') : null),
'title' => get_string('visastatus', 'artefact.resume'),
......@@ -90,7 +90,7 @@ $personalinformationform = pieform(array(
'size' => 30,
),
'gender' => array(
'type' => 'radio',
'type' => 'radio',
'defaultvalue' => ((!empty($personalinformation))
? $personalinformation->get_composite('gender') : null),
'options' => array(
......
......@@ -6,7 +6,7 @@
* @author Francois Marier <francois@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*
*/
function xmldb_auth_browserid_upgrade($oldversion=0) {
......
......@@ -6,7 +6,7 @@
* @author Francois Marier <francois@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*
*/
defined('INTERNAL') || die();
......
......@@ -6,7 +6,7 @@
* @author Francois Marier <francois@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*
*/
defined('INTERNAL') || die();
......
......@@ -6,7 +6,7 @@
* @author Francois Marier <francois@catalyst.net.nz>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*
*/
define('INTERNAL', 1);
......
......@@ -66,11 +66,11 @@ class AuthImap extends Auth {
$connectionstring = '{'.
$this->config['host']
.':'.
.':'.
$this->config['port']
.
$this->config['protocol']
.'}';
.'}';
try {
$connection = imap_open($connectionstring, $user->username, $password, OP_HALFOPEN);
......
......@@ -59,7 +59,7 @@ class AuthInternal extends Auth {
}
/**
* Internal authentication never auto-creates users - users instead
* Internal authentication never auto-creates users - users instead
* register through register.php
*/
public function can_auto_create_users() {
......@@ -118,7 +118,7 @@ class AuthInternal extends Auth {
/**
* Internal authentication allows most standard us-keyboard-typable characters
* for username, as long as the username is between three and thirty
* for username, as long as the username is between three and thirty
* characters in length.
*
* This method is NOT part of the authentication API. Other authentication
......@@ -135,7 +135,7 @@ class AuthInternal extends Auth {
* Internal authentication allows most standard us-keyboard-typable characters
* for username, as long as the username is between three and 236
* for username, as long as the username is between three and 236
* characters in length.
*
* This method is NOT part of the authentication API. Other authentication
......
......@@ -21,7 +21,7 @@ require_once(get_config('docroot') . '/lib/htmloutput.php');
class AuthUnknownUserException extends UserException {}
/**
* An instance of an auth plugin failed during execution
* An instance of an auth plugin failed during execution
* e.g. LDAP auth failed to connect to a directory
* Developers can use this to fail an individual auth
* instance, but not kill all from being tried.
......@@ -37,7 +37,7 @@ class AuthInstanceException extends UserException {
}
/**
* We tried to call a method on an auth plugin that hasn't been init'ed
* We tried to call a method on an auth plugin that hasn't been init'ed
* successfully
*/
class UninitialisedAuthException extends SystemException {}
......@@ -112,7 +112,7 @@ abstract class Auth {
$this->priority = $instance->priority;
$this->authname = $instance->authname;
// Return now if the plugin type doesn't require any config
// Return now if the plugin type doesn't require any config
// (e.g. internal)
if ($this->has_instance_config == false) {
return true;
......@@ -134,7 +134,7 @@ abstract class Auth {
/**
* The __get overloader is invoked when the requested member is private or
* protected, or just doesn't exist.
*
*
* @param string $name The name of the value to fetch
* @return mixed The value
*/
......@@ -153,7 +153,7 @@ abstract class Auth {
/**
* The __set overloader is invoked when the specified member is private or
* protected, or just doesn't exist.
*
*
* @param string $name The name of the value to set
* @param mixed $value The value to assign
* @return void
......@@ -170,9 +170,9 @@ abstract class Auth {
/**
* Check that the plugin has been initialised before we try to use it.
*
*
* @throws UninitialisedAuthException
* @return bool
* @return bool
*/
protected function must_be_ready() {
if ($this->ready == false) {
......@@ -184,7 +184,7 @@ abstract class Auth {
/**
* Fetch the URL that users can visit to change their passwords. This might
* be a Moodle installation, for example.
*
*
* @return mixed URL to change password or false if there is none
*/
public function changepasswordurl() {
......@@ -280,7 +280,7 @@ abstract class Auth {
* The default behaviour is to assume that the password is in a valid form,
* so make sure to implement this method if this is not the case!
*
* This method is defined to be empty, so that authentication methods do
* This method is defined to be empty, so that authentication methods do
* not have to specify a format if they do not need to.
*
* @param string $password The password to check
......@@ -303,21 +303,21 @@ abstract class Auth {
}
/**
* Called when a user is being logged out, either by clicking a logout
* link, their session timing out or some other method where their session
* is explicitly being ended with no more processing to take place on this
* Called when a user is being logged out, either by clicking a logout
* link, their session timing out or some other method where their session
* is explicitly being ended with no more processing to take place on this
* page load.
*
* You can use $USER->logout() to log a user out but continue page
* processing if necessary. register.php is an example of such a place
* You can use $USER->logout() to log a user out but continue page
* processing if necessary. register.php is an example of such a place
* where this happens.
*
* If you define this hook, you can call $USER->logout() in it if you need
* to before redirecting. Otherwise, it will be called for you once your
* If you define this hook, you can call $USER->logout() in it if you need
* to before redirecting. Otherwise, it will be called for you once your
* hook has run.
*
* If you do not explicitly redirect yourself, once this hook is finished
* the user will be redirected to the homepage with a message saying they
* If you do not explicitly redirect yourself, once this hook is finished
* the user will be redirected to the homepage with a message saying they
* have been logged out successfully.
*
* This method has no parameters and needs no return value
......@@ -362,7 +362,7 @@ abstract class Auth {
/******************************************************************************/
/**
* Handles authentication by setting up a session for a user if they are logged
* Handles authentication by setting up a session for a user if they are logged
* in.
*
* This function combined with the Session class is smart - if the user is not
......@@ -470,7 +470,7 @@ function auth_setup () {
$mnetuser = 0;
if ($SESSION->get('mnetuser') && $authobj->parent) {
// We wish to remember that the user is an MNET user - even though
// We wish to remember that the user is an MNET user - even though
// they're using the local login form
$mnetuser = $USER->get('id');
}
......@@ -522,7 +522,7 @@ function auth_setup () {
if ($USER->is_logged_in()) {
return;
}
// Check if the page is public or the site is configured to be public.
if (defined('PUBLIC') && !isset($_GET['login'])) {
if ($lang = param_alphanumext('lang', null)) {
......@@ -535,14 +535,14 @@ function auth_setup () {
if (defined('JSON')) {
json_reply('global', get_string('nosessionreload'), 1);
}
auth_draw_login_page(null, $form);
exit;
}
}
/**
*
*
* Returns all auth instances
*
* @return array Array of auth instance records
......@@ -561,10 +561,10 @@ function auth_get_auth_instances() {
inst.displayname,
i.instancename,
i.authname
FROM
FROM
{institution} inst,
{auth_instance} i
WHERE
WHERE
i.institution = inst.name
ORDER BY
inst.displayname,
......@@ -581,7 +581,7 @@ function auth_get_auth_instances() {
/**
*
*
* Given a list of institutions, returns all auth instances associated with them
*
* @return array Array of auth instance records
......@@ -597,10 +597,10 @@ function auth_get_auth_instances_for_institutions($institutions) {
inst.displayname,
i.instancename,
i.authname
FROM
FROM
{institution} inst,
{auth_instance} i
WHERE
WHERE
i.institution = inst.name AND
inst.name IN (' . join(',', array_map('db_quote',$institutions)) . ')
ORDER BY
......@@ -612,7 +612,7 @@ function auth_get_auth_instances_for_institutions($institutions) {
/**
* Given an institution, returns the authentication methods used by it, sorted
* Given an institution, returns the authentication methods used by it, sorted
* by priority.
*
* @param string $institution Name of the institution
......@@ -639,10 +639,10 @@ function auth_get_auth_instances_for_institution($institution=null) {
i.authname,
a.requires_config,
a.requires_parent
FROM
FROM
{auth_instance} i,
{auth_installed} a
WHERE
WHERE
a.name = i.authname AND
i.institution = '. db_quote($institution).'
ORDER BY
......@@ -661,7 +661,7 @@ function auth_get_auth_instances_for_institution($institution=null) {
/**
* Given a wwwroot, find any auth instances that can come from that host
*
*
* @param string wwwroot of the host that is connecting to us
* @return array array of record objects
*/
......@@ -674,7 +674,7 @@ function auth_get_auth_instances_for_wwwroot($wwwroot) {
aic.*,
i.*
FROM
{auth_instance} ai,
{auth_instance} ai,
{auth_instance_config} aic,
{institution} i
WHERE
......@@ -687,7 +687,7 @@ function auth_get_auth_instances_for_wwwroot($wwwroot) {
}
/**
* Given an institution, get all the auth types EXCEPT those that are already
* Given an institution, get all the auth types EXCEPT those that are already
* enabled AND do not require configuration.
*
* @param string $institution Name of the institution
......@@ -704,11 +704,11 @@ function auth_get_available_auth_types($institution=null) {
SELECT DISTINCT
a.name,
a.requires_config
FROM
FROM
{auth_installed} a
LEFT JOIN
LEFT JOIN
{auth_instance} i
ON
ON
a.name = i.authname AND
i.institution = '. db_quote($institution).'
WHERE
......@@ -716,7 +716,7 @@ function auth_get_available_auth_types($institution=null) {
i.id IS NULL) AND
a.active = 1
ORDER BY
a.name';
a.name';
if (is_null($institution)) {
$result = get_records_array('auth_installed', '','','name','name, requires_config');
......@@ -830,8 +830,8 @@ function auth_check_required_fields() {
$alwaysmandatoryfields = array_keys(ArtefactTypeProfile::get_always_mandatory_fields());
foreach(ArtefactTypeProfile::get_mandatory_fields() as $field => $type) {
// Always mandatory fields are stored in the usr table, so are part of
// the user session object. We can save a query by grabbing them from
// Always mandatory fields are stored in the usr table, so are part of
// the user session object. We can save a query by grabbing them from
// the session.
if (in_array($field, $alwaysmandatoryfields) && $USER->get($field) != null) {
continue;
......@@ -1394,8 +1394,8 @@ class AuthFactory {
static $authcache = array();
/**
* Take an instanceid and create an auth object for that instance.
*
* Take an instanceid and create an auth object for that instance.
*
* @param int $id The id of the auth instance
* @return Auth An intialised auth object or false, if the
* instance doesn't exist (Should never happen)
......@@ -1450,7 +1450,7 @@ function login_submit(Pieform $form, $values) {
// If the user doesn't exist, check for institutions that
// want to create users automatically.
try {
// Reset the LiveUser object, since we are attempting to create a
// Reset the LiveUser object, since we are attempting to create a
// new user
$SESSION->destroy_session();
$USER = new LiveUser();
......@@ -1552,8 +1552,8 @@ function login_submit(Pieform $form, $values) {
}
catch (AuthUnknownUserException $e) {
// We weren't able to authenticate the user for some reason that
// probably isn't their fault (e.g. ldap extension not available
// We weren't able to authenticate the user for some reason that
// probably isn't their fault (e.g. ldap extension not available
// when using ldap authentication)
log_info($e->getMessage());
$SESSION->add_error_msg(get_string('loginfailed'));
......@@ -1716,7 +1716,7 @@ function auth_handle_account_expiries() {
}
}
if ($expire) {
// Inactivity (lastlogin is too old)
......@@ -1759,7 +1759,7 @@ function auth_handle_account_expiries() {
}
// Institution membership expiry
delete_records_sql('DELETE FROM {usr_institution}
delete_records_sql('DELETE FROM {usr_institution}
WHERE ' . db_format_tsfield('expiry', false) . ' < ? AND expirymailsent = 1', array(time()));
// Institution membership expiry warnings
......@@ -1860,7 +1860,7 @@ function auth_handle_institution_expiries() {
/**
* Clears out old session files
*
* This should be run once every now and then (once a day is good), to clean
* This should be run once every now and then (once a day is good), to clean
* out session files of users whose sessions have timed out.
*/
function auth_remove_old_session_files() {
......@@ -1901,7 +1901,7 @@ function auth_remove_old_session_files() {
/**
* Generates the login form for the sideblock.
*
* {@internal{Not sure why this form definition doesn't use
* {@internal{Not sure why this form definition doesn't use
* auth_get_login_form, but keep that in mind when making changes.}}
*/
function auth_generate_login_form() {
......@@ -2430,7 +2430,7 @@ class PluginAuth extends Plugin {
}
/**
* Can be overridden by plugins to assert when they are able to be used.
* Can be overridden by plugins to assert when they are able to be used.
* For example, a plugin might check that a certain PHP extension is loaded
*/
public static function is_usable() {
......
......@@ -13,7 +13,7 @@ defined('INTERNAL') || die();
require_once(get_config('docroot') . 'auth/lib.php');
/**
* This authentication method allows ANY user access to Mahara. It's useful for
* This authentication method allows ANY user access to Mahara. It's useful for
* testing ONLY!
*/
class AuthNone extends Auth {
......
......@@ -245,7 +245,7 @@ class AuthSaml extends Auth {
// tidy up the session for retries
$SESSION->set('messages', array());
$SESSION->set('wantsurl', null);
// redirect for logout of SAML 2.0 IdP
redirect($CFG->wwwroot.'/auth/saml/index.php?logout=1');
}
......
......@@ -3,7 +3,7 @@
About validateUrlSyntax():
This function will verify if a http URL is formatted properly, returning
either with true or false.
I used rfc #2396 URI: Generic Syntax as my guide when creating the
regular expression. For all the details see the comments below.
......@@ -12,7 +12,7 @@ Usage:
validateUrlSyntax( url_to_check[, options])
url_to_check - string - The url to check
options - string - A optional string of options to set which parts of
the url are required, optional, or not allowed. Each option
must be followed by a "+" for required, "?" for optional, or
......@@ -108,7 +108,7 @@ Changelog:
August 29, 2003
-Allowed port numbers above 9999. Now allows up to 69999
Sometime, 2002
-Added new top level domains
-aero, coop, museum, name, info, biz, pro
......@@ -130,7 +130,7 @@ Known Problems:
Author(s):
Rod Apeldoorn - rod(at)canowhoopass(dot)com
Homepage:
http://www.canowhoopass.com/
......@@ -143,7 +143,7 @@ Thanks!:
License:
Copyright 2004, Rod Apeldoorn
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
......@@ -233,7 +233,7 @@ function validateUrlSyntax( $urladdr, $options="" ){
$aOptions[$key] = '';
}
}
// DEBUGGING - Unescape following line to display to screen current option values
// echo '<pre>'; print_r($aOptions); echo '</pre>';
......@@ -243,7 +243,7 @@ function validateUrlSyntax( $urladdr, $options="" ){
$unreserved = '[a-zA-Z0-9_.!~*' . '\'' . '()-]';
$escaped = '(%[0-9a-fA-F]{2})'; // Escape sequence - In Hex - %6d would be a 'm'
$reserved = '[;/?:@&=+$,]'; // Special characters in the URI
// Beginning Regular Expression
// Scheme - Allows for 'http://', 'https://', 'mailto:', or 'ftp://'
$scheme = '(';
......@@ -261,14 +261,14 @@ function validateUrlSyntax( $urladdr, $options="" ){
}
$scheme .= ')' . $aOptions['s'];
// End setting scheme
// User Info - Allows for 'username@' or 'username:password@'. Note: contrary to rfc, I removed ':' from username section, allowing it only in password.
// /---------------- Username -----------------------\ /-------------------------------- Password ------------------------------\
$userinfo = '((' . $unreserved . '|' . $escaped . '|[;&=+$,]' . ')+(:(' . $unreserved . '|' . $escaped . '|[;:&=+$,]' . ')+)' . $aOptions['P'] . '@)' . $aOptions['u'];
// IP ADDRESS - Allows 0.0.0.0 to 255.255.255.255
$ipaddress = '((((2(([0-4][0-9])|(5[0-5])))|([01]?[0-9]?[0-9]))\.){3}((2(([0-4][0-9])|(5[0-5])))|([01]?[0-9]?[0-9])))';
// Tertiary Domain(s) - Optional - Multi - Although some sites may use other characters, the RFC says tertiary domains have the same naming restrictions as second level domains
$domain_tertiary = '(' . $alphanum . '(([a-zA-Z0-9-]{0,62})' . $alphanum . ')?\.)*';
......@@ -282,7 +282,7 @@ function validateUrlSyntax( $urladdr, $options="" ){
$domain_toplevel = '([a-zA-Z](([a-zA-Z0-9-]*)[a-zA-Z0-9])?)';
/* // Top Level Domain - Required - Domain List Current As Of December 2004. Use above escaped line to be forgiving of possible future TLD's
$domain_toplevel = '(aero|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|post|pro|travel|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ax|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)';
*/
*/
// Address can be IP address or Domain
if ($aOptions['I'] === '{0}') { // IP Address Not Allowed
......@@ -293,24 +293,24 @@ function validateUrlSyntax( $urladdr, $options="" ){
$address = '((' . $ipaddress . ')|(' . $domain_tertiary . /* MDL-9295 $domain_secondary . */ $domain_toplevel . '))';
}
$address = $address . $aOptions['a'];
// Port Number - :80 or :8080 or :65534 Allows range of :0 to :65535
// (0-59999) |(60000-64999) |(65000-65499) |(65500-65529) |(65530-65535)
$port_number = '(:(([0-5]?[0-9]{1,4})|(6[0-4][0-9]{3})|(65[0-4][0-9]{2})|(655[0-2][0-9])|(6553[0-5])))' . $aOptions['p'];
// Path - Can be as simple as '/' or have multiple folders and filenames
$path = '(/((;)?(' . $unreserved . '|' . $escaped . '|' . '[:@&=+$,]' . ')+(/)?)*)' . $aOptions['f'];
// Query Section - Accepts ?var1=value1&var2=value2 or ?2393,1221 and much more
$querystring = '(\?(' . $reserved . '|' . $unreserved . '|' . $escaped . ')*)' . $aOptions['q'];
// Fragment Section - Accepts anchors such as #top
$fragment = '(#(' . $reserved . '|' . $unreserved . '|' . $escaped . ')*)' . $aOptions['r'];
// Building Regular Expression
$regexp = '^' . $scheme . $userinfo . $address . $port_number . $path . $querystring . $fragment . '$';
// DEBUGGING - Uncomment Line Below To Display The Regular Expression Built
// echo '<pre>' . htmlentities(wordwrap($regexp,70,"\n",1)) . '</pre>';
......@@ -339,7 +339,7 @@ Usage: