Skip to content

Commit

Permalink
MDL-20700 coding style cleanup - cvs keywords removed, closign php ta…
Browse files Browse the repository at this point in the history
…g removed, trailing whitespace cleanup
  • Loading branch information
skodak committed Nov 1, 2009
1 parent 4a0e2e6 commit 5117d59
Show file tree
Hide file tree
Showing 34 changed files with 224 additions and 234 deletions.
2 changes: 1 addition & 1 deletion auth/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ They contain the same functions that were previously in each plugin's lib.php fi
but refactored to become class methods, and tweaked to reference the plugin's instantiated
config to get at the settings, rather than the global $CFG variable.

When creating new plugins you can either extend the abstract auth_plugin_base class
When creating new plugins you can either extend the abstract auth_plugin_base class
(defined in lib/authlib.php) or create a new one and implement all methods from
auth_plugin_base.

Expand Down
10 changes: 5 additions & 5 deletions auth/cas/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function loginpage_hook() {
$frm->password="guest";
return;
}

if ($this->config->multiauth) {
$authCAS = optional_param("authCAS", '', PARAM_RAW);
if ($authCAS=="NOCAS")
Expand Down Expand Up @@ -443,7 +443,7 @@ function get_userinfo_asobj($username) {
*/
function ldap_connect($binddn='',$bindpwd='') {
// Cache ldap connections (they are expensive to set up
// and can drain the TCP/IP ressources on the server if we
// and can drain the TCP/IP ressources on the server if we
// are syncing a lot of users (as we try to open a new connection
// to get the user details). This is the least invasive way
// to reuse existing connections without greater code surgery.
Expand Down Expand Up @@ -488,7 +488,7 @@ function ldap_connect($binddn='',$bindpwd='') {
if ($bindresult) {
// Set the connection counter so we can call PHP's ldap_close()
// when we call $this->ldap_close() for the last 'open' connection.
$this->ldapconns = 1;
$this->ldapconns = 1;
$this->ldapconnection = $connresult;
return $connresult;
}
Expand Down Expand Up @@ -695,7 +695,7 @@ function sync_users ($do_updates = true) {
// find users in DB that aren't in ldap -- to be removed!
// this is still not as scalable (but how often do we mass delete?)
if (!empty($this->config->removeuser)) {
$sql = "SELECT u.id, u.username, u.email, u.auth
$sql = "SELECT u.id, u.username, u.email, u.auth
FROM {user} u
LEFT JOIN {tmp_extuser} e ON (u.username = e.username AND u.mnethostid = ?)
WHERE u.auth='cas'
Expand Down Expand Up @@ -1139,4 +1139,4 @@ function filter_addslashes($text) {
return $text;
}
}
?>

1 change: 0 additions & 1 deletion auth/cas/cas_ldap_sync_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@
$casauth = get_auth_plugin('cas');
$casauth->sync_users(true);

?>
14 changes: 7 additions & 7 deletions auth/cas/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@

// set to defaults if undefined (CAS)

if (!isset ($config->hostname))
if (!isset ($config->hostname))

$config->hostname = '';

if (!isset ($config->port))
if (!isset ($config->port))

$config->port = '';

if (!isset ($config->casversion))
if (!isset ($config->casversion))

$config->casversion = '';

if (!isset ($config->baseuri))
if (!isset ($config->baseuri))

$config->baseuri = '';

if (!isset ($config->language))
if (!isset ($config->language))

$config->language = '';

if (!isset ($config->proxycas))
if (!isset ($config->proxycas))

$config->proxycas = '';

if (!isset ($config->logoutcas))
if (!isset ($config->logoutcas))

$config->logoutcas = '';

Expand Down
4 changes: 0 additions & 4 deletions auth/cas/languages.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?PHP

// version $Id$

// List of CAS langages.

// You can add langages in /CAS/langage.
Expand All @@ -13,5 +11,3 @@
"english" => "English",

"french" => "French");

?>
2 changes: 1 addition & 1 deletion auth/db/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -702,4 +702,4 @@ function ext_addslashes($text) {
}
}

?>

1 change: 0 additions & 1 deletion auth/db/auth_db_sync_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@
$dbauth = get_auth_plugin('db');
$dbauth->sync_users(true);

?>
14 changes: 7 additions & 7 deletions auth/email/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ function can_signup() {
function user_signup($user, $notify=true) {
global $CFG, $DB;
require_once($CFG->dirroot.'/user/profile/lib.php');

$user->password = hash_internal_user_password($user->password);

if (! ($user->id = $DB->insert_record('user', $user)) ) {
print_error('auth_emailnoinsert','auth_email');
}

/// Save any custom profile field information
profile_save_data($user);

Expand Down Expand Up @@ -201,15 +201,15 @@ function config_form($config, $err, $user_fields) {
*/
function process_config($config) {
// set to defaults if undefined
if (!isset($config->recaptcha)) {
$config->recaptcha = false;
if (!isset($config->recaptcha)) {
$config->recaptcha = false;
}

// save settings
set_config('recaptcha', $config->recaptcha, 'auth/email');
return true;
}

/**
* Returns whether or not the captcha element is enabled, and the admin settings fulfil its requirements.
* @return bool
Expand All @@ -221,4 +221,4 @@ function is_captcha_enabled() {

}

?>

2 changes: 1 addition & 1 deletion auth/email/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2 class="main"><?php print_string('auth_emailsettings', 'auth_email') ?> </h2>
echo $OUTPUT->select(html_select::make($yesno, 'recaptcha', $config->recaptcha, false));
?></td>
<td><?php print_string('auth_emailrecaptcha', 'auth_email') ?></td>
</tr>
</tr>
<?php

print_auth_lock_options('email', $user_fields, get_string('auth_fieldlocks_help', 'auth'), false, false);
Expand Down
2 changes: 1 addition & 1 deletion auth/fc/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,4 @@ function process_config($config) {

}

?>

2 changes: 1 addition & 1 deletion auth/imap/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@ function process_config($config) {

}

?>

28 changes: 14 additions & 14 deletions auth/ldap/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ function sync_users($do_updates=true) {
// find users in DB that aren't in ldap -- to be removed!
// this is still not as scalable (but how often do we mass delete?)
if (!empty($this->config->removeuser)) {
$sql = "SELECT u.id, u.username, u.email, u.auth
$sql = "SELECT u.id, u.username, u.email, u.auth
FROM {user} u
LEFT JOIN {tmp_extuser} e ON (u.username = e.username AND u.mnethostid = ?)
WHERE u.auth='ldap'
Expand Down Expand Up @@ -1518,7 +1518,7 @@ function ldap_isgroupmember($extusername='', $groupdns='') {
*/
function ldap_connect($binddn='',$bindpwd='') {
// Cache ldap connections (they are expensive to set up
// and can drain the TCP/IP ressources on the server if we
// and can drain the TCP/IP ressources on the server if we
// are syncing a lot of users (as we try to open a new connection
// to get the user details). This is the least invasive way
// to reuse existing connections without greater code surgery.
Expand Down Expand Up @@ -1575,7 +1575,7 @@ function ldap_connect($binddn='',$bindpwd='') {
if ($bindresult) {
// Set the connection counter so we can call PHP's ldap_close()
// when we call $this->ldap_close() for the last 'open' connection.
$this->ldapconns = 1;
$this->ldapconns = 1;
$this->ldapconnection = $connresult;
return $connresult;
}
Expand Down Expand Up @@ -1799,7 +1799,7 @@ function loginpage_hook() {

// HTTPS is potentially required
httpsrequired();

if (($_SERVER['REQUEST_METHOD'] === 'GET' // Only on initial GET of loginpage
|| ($_SERVER['REQUEST_METHOD'] === 'POST'
&& (get_referer() != strip_querystring(qualified_me()))))
Expand Down Expand Up @@ -1834,7 +1834,7 @@ function loginpage_hook() {
redirect($CFG->wwwroot.'/auth/ldap/ntlmsso_attempt.php');
}
}

// No NTLM SSO, Use the normal login page instead.

// If $SESSION->wantsurl is empty and we have a 'Referer:' header, the login
Expand All @@ -1852,17 +1852,17 @@ function loginpage_hook() {

/**
* To be called from a page running under NTLM's
* "Integrated Windows Authentication".
* "Integrated Windows Authentication".
*
* If successful, it will set a special "cookie" (not an HTTP cookie!)
* If successful, it will set a special "cookie" (not an HTTP cookie!)
* in cache_flags under the "auth/ldap/ntlmsess" "plugin" and return true.
* The "cookie" will be picked up by ntlmsso_finish() to complete the
* process.
*
* On failure it will return false for the caller to display an appropriate
* error message (probably saying that Integrated Windows Auth isn't enabled!)
*
* NOTE that this code will execute under the OS user credentials,
* NOTE that this code will execute under the OS user credentials,
* so we MUST avoid dealing with files -- such as session files.
* (The caller should define('NO_MOODLE_COOKIES', true) before including config.php)
*
Expand All @@ -1886,13 +1886,13 @@ function ntlmsso_magic($sesskey) {
}

/**
* Find the session set by ntlmsso_magic(), validate it and
* Find the session set by ntlmsso_magic(), validate it and
* call authenticate_user_login() to authenticate the user through
* the auth machinery.
*
*
* It is complemented by a similar check in user_login().
*
* If it succeeds, it never returns.
*
* If it succeeds, it never returns.
*
*/
function ntlmsso_finish() {
Expand Down Expand Up @@ -1932,7 +1932,7 @@ function ntlmsso_finish() {
}
// Should never reach here.
return false;
}
}

/**
* Sync roles for this user
Expand Down Expand Up @@ -2236,4 +2236,4 @@ function ldap_get_ad_pwdexpire($pwdlastset, $ldapconn, $user_dn){

}

?>

2 changes: 1 addition & 1 deletion auth/ldap/auth_ldap_sync_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
$ldapauth = get_auth_plugin('ldap');
$ldapauth->sync_users(true);

?>

2 changes: 1 addition & 1 deletion auth/ldap/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
{$config->forcechangepassword = 0; }
if (!isset($config->stdchangepassword))
{$config->stdchangepassword = 0; }
if (!isset($config->passtype))
if (!isset($config->passtype))
{$config->passtype = 'plaintext';}
if (!isset($config->changepasswordurl))
{$config->changepasswordurl = ''; }
Expand Down
2 changes: 1 addition & 1 deletion auth/ldap/ntlmsso_finish.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
$PAGE->set_title("$site->fullname: $loginsite");
$PAGE->set_heading($site->fullname);
echo $OUTPUT->header();
redirect($CFG->httpswwwroot . '/login/index.php?authldap_skipntlmsso=1',
redirect($CFG->httpswwwroot . '/login/index.php?authldap_skipntlmsso=1',
get_string('ntlmsso_failed','auth_ldap'), 3);
}
6 changes: 3 additions & 3 deletions auth/ldap/ntlmsso_magic.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
$sesskey = required_param('sesskey', PARAM_RAW);
$file = $CFG->dirroot . '/pix/spacer.gif';

if ($authplugin->ntlmsso_magic($sesskey)
if ($authplugin->ntlmsso_magic($sesskey)
&& file_exists($file)) {

if (!empty($authplugin->config->ntlmsso_ie_fastpath)) {
if (check_browser_version('MSIE')) {
redirect($CFG->wwwroot . '/auth/ldap/ntlmsso_finish.php');
}
}
}

// Serve GIF
// Type
Expand All @@ -47,4 +47,4 @@
print_error('ntlmsso_iwamagicnotenabled','auth_ldap');
}

?>

8 changes: 4 additions & 4 deletions auth/manual/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ function process_config($config) {

/**
* Confirm the new user as registered. This should normally not be used,
* but it may be necessary if the user auth_method is changed to manual
* but it may be necessary if the user auth_method is changed to manual
* before the user is confirmed.
*/
function user_confirm($username, $confirmsecret = null) {
function user_confirm($username, $confirmsecret = null) {
global $DB;

$user = get_complete_user_data('username', $username);

if (!empty($user)) {
if ($user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else {
} else {
if (!$DB->set_field("user", "confirmed", 1, array("id"=>$user->id))) {
return AUTH_CONFIRM_FAIL;
}
Expand All @@ -148,4 +148,4 @@ function user_confirm($username, $confirmsecret = null) {

}

?>

6 changes: 2 additions & 4 deletions auth/mnet/auth.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php // $Id$
<?php

/**
* @author Martin Dougiamas
Expand Down Expand Up @@ -874,7 +874,7 @@ function refresh_log($array) {
unset($logEntryObj->username);

$logEntryObj = $this->trim_logline($logEntryObj);
$insertok = $DB->insert_record('mnet_log', $logEntryObj, false);
$insertok = $DB->insert_record('mnet_log', $logEntryObj, false);

if ($insertok) {
$MNET_REMOTE_CLIENT->last_log_id = $logEntryObj->remoteid;
Expand Down Expand Up @@ -1349,5 +1349,3 @@ function trim_logline ($logline) {


}

?>
2 changes: 1 addition & 1 deletion auth/mnet/jump.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
}
redirect($url);

?>

2 changes: 1 addition & 1 deletion auth/mnet/land.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
}
redirect($CFG->wwwroot . $wantsurl);

?>

2 changes: 1 addition & 1 deletion auth/nntp/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ function process_config($config) {

}

?>

Loading

0 comments on commit 5117d59

Please sign in to comment.