Skip to content

Commit

Permalink
MDL-20700 whitespace terror returns
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Dec 16, 2009
1 parent b5d0caf commit 4454447
Show file tree
Hide file tree
Showing 55 changed files with 416 additions and 418 deletions.
96 changes: 48 additions & 48 deletions auth/cas/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function prevent_local_passwords() {
* @return bool Authentication success or failure.
*/
function user_login ($username, $password) {
$this->connectCAS();
$this->connectCAS();
return phpCAS::isAuthenticated() && (trim(moodle_strtolower(phpCAS::getUser())) == $username);
}
/**
Expand Down Expand Up @@ -91,43 +91,43 @@ function can_change_password() {
function loginpage_hook() {
global $frm;
global $CFG;
global $SESSION, $OUTPUT;
global $SESSION, $OUTPUT;

$site = get_site();
$CASform = get_string("CASform","auth_cas");
$username = optional_param("username", '', PARAM_RAW);

if (!empty($username)) {
if (strstr($SESSION->wantsurl,'ticket') || strstr($SESSION->wantsurl,'NOCAS'))
unset($SESSION->wantsurl);
return;
if (strstr($SESSION->wantsurl,'ticket') || strstr($SESSION->wantsurl,'NOCAS'))
unset($SESSION->wantsurl);
return;
}


// Test si cas activ� et param�tres non remplis
if (empty($this->config->hostname)) {
return;
}

// Test si cas activ� et param�tres non remplis
if (empty($this->config->hostname)) {
return;
}

// Connection to CAS server
$this->connectCAS();

// Gestion de la connection CAS si acc�s direct d'un ent ou autre
if (phpCAS::checkAuthentication()) {
$frm->username=phpCAS::getUser();
// if (phpCAS::getUser()=='esup9992')
// $frm->username='erhar0062';
$frm->password="passwdCas";
return;
}

if ($_GET["loginguest"]== true) {
$frm->username="guest";
$frm->password="guest";
return;
}
$this->connectCAS();

// Gestion de la connection CAS si acc�s direct d'un ent ou autre
if (phpCAS::checkAuthentication()) {
$frm->username=phpCAS::getUser();
// if (phpCAS::getUser()=='esup9992')
// $frm->username='erhar0062';
$frm->password="passwdCas";
return;
}

if ($_GET["loginguest"]== true) {
$frm->username="guest";
$frm->password="guest";
return;
}

if ($this->config->multiauth) {
$authCAS = optional_param("authCAS", '', PARAM_RAW);
if ($authCAS=="NOCAS")
Expand All @@ -144,7 +144,7 @@ function loginpage_hook() {
include($CFG->dirroot."/auth/cas/cas_form.html");
echo $OUTPUT->footer();
exit();
}
}
}
// CAS authentication
if (!phpCAS::isAuthenticated())
Expand All @@ -158,11 +158,11 @@ function loginpage_hook() {
*/
function prelogout_hook() {
global $CFG;
if ($this->config->logoutcas ) {
$backurl = $CFG->wwwroot;
$this->connectCAS();
phpCAS::logout($backurl);
}
if ($this->config->logoutcas ) {
$backurl = $CFG->wwwroot;
$this->connectCAS();
phpCAS::logout($backurl);
}
}
/**
* Connect to the cas (clientcas connection or proxycas connection
Expand All @@ -171,20 +171,20 @@ function prelogout_hook() {
*
*/
function connectCAS() {
global $PHPCAS_CLIENT;

global $PHPCAS_CLIENT;
// mode proxy CAS
if ( !is_object($PHPCAS_CLIENT) ) {
if ($this->config->proxycas) {
phpCAS::proxy($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri);
}
if ($this->config->proxycas) {
phpCAS::proxy($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri);
}
// mode client CAS
else {
phpCAS::client($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri);
}
else {
phpCAS::client($this->config->casversion, $this-> config->hostname, (int) $this->config->port, $this->config->baseuri);
}
}

}

}
/**
* Prints a form for configuring this authentication plugin.
*
Expand Down Expand Up @@ -974,16 +974,16 @@ function iscreator($username) {
$filter = "(& (".$this->config->user_attribute."=$username)(|";
foreach ($attrs as $attr){
if(strpos($attr, "="))
$filter .= "($attr)";
$filter .= "($attr)";
else
$filter .= "(".$this->config->memberattribute."=$attr)";
$filter .= "(".$this->config->memberattribute."=$attr)";
}
$filter .= "))";
//search
$result = $this->ldap_get_userlist($filter);
if (count($result)!=0)
return true;
}
return true;
}

return false;
}
Expand Down Expand Up @@ -1089,7 +1089,7 @@ function ldap_get_entries($conn, $searchresult) {
do {
$attributes = @ldap_get_attributes($conn, $entry);
for ($j=0; $j<$attributes['count']; $j++) {
$values = ldap_get_values_len($conn, $entry,$attributes[$j]);
$values = ldap_get_values_len($conn, $entry,$attributes[$j]);

if (is_array($values)) {
$fresult[$i][strtolower($attributes[$j])] = $values;
Expand Down
4 changes: 2 additions & 2 deletions auth/ldap/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -1567,8 +1567,8 @@ 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.
// 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->ldapconnection = $connresult;
return $connresult;
Expand Down
52 changes: 26 additions & 26 deletions blocks/section_links/config_instance.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php
$numberofsections = array();
for ($i = 1; $i < 53; $i++){
$numberofsections[$i] = $i;
$numberofsections[$i] = $i;
}

$increments = array();

for ($i = 1; $i < 11; $i++){
$increments[$i] = $i;
$increments[$i] = $i;
}

if(isset($this->config)){
$config = $this->config;
$config = $this->config;
} else{
$config = get_config('blocks/section_links');
$config = get_config('blocks/section_links');
}

$selected = array();
Expand All @@ -40,28 +40,28 @@
<?php
for($i = 1; $i < 3; $i++){
?>
<tr valign="top">
<td align="right">
<?php print_string('numsections'.$i, 'block_section_links'); ?>:
</td>
<td>
<?php choose_from_menu($numberofsections, 'numsections'.$i, $selected[$i][0]); ?>
</td>
<td>
<?php print_string('numsectionsdesc'.$i, 'block_section_links'); ?>
</td>
</tr>
<tr valign="top">
<td align="right">
<?php print_string('incby'.$i, 'block_section_links'); ?>:
</td>
<td>
<?php choose_from_menu($increments, 'incby'.$i, $selected[$i][1]); ?>
</td>
<td>
<?php print_string('incbydesc'.$i, 'block_section_links'); ?>
</td>
</tr>
<tr valign="top">
<td align="right">
<?php print_string('numsections'.$i, 'block_section_links'); ?>:
</td>
<td>
<?php choose_from_menu($numberofsections, 'numsections'.$i, $selected[$i][0]); ?>
</td>
<td>
<?php print_string('numsectionsdesc'.$i, 'block_section_links'); ?>
</td>
</tr>
<tr valign="top">
<td align="right">
<?php print_string('incby'.$i, 'block_section_links'); ?>:
</td>
<td>
<?php choose_from_menu($increments, 'incby'.$i, $selected[$i][1]); ?>
</td>
<td>
<?php print_string('incbydesc'.$i, 'block_section_links'); ?>
</td>
</tr>
<?php }
?>
<tr>
Expand Down
4 changes: 2 additions & 2 deletions blocks/section_links/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
$numberofsections = array();

for ($i = 1; $i < 53; $i++){
$numberofsections[$i] = $i;
$numberofsections[$i] = $i;
}
$increments = array();

for ($i = 1; $i < 11; $i++){
$increments[$i] = $i;
$increments[$i] = $i;
}

$selected = array(1 => array(22,2),
Expand Down
2 changes: 1 addition & 1 deletion calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ YAHOO.moodle.container.calendarpanels = [];
* has been resolved.
*/
YAHOO.util.Event.onDOMReady(function () {
//TODO: remove this hack MDL-20204
//TODO: remove this hack MDL-20204
var animationlib = document.createElement('script');
animationlib.setAttribute('type','text/javascript');
animationlib.setAttribute('src',moodle_cfg.wwwroot+'/lib/yui/2.8.0r4/animation/animation-min.js');
Expand Down
98 changes: 49 additions & 49 deletions calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,55 +539,55 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course

echo "</table>\n"; // Tabular display of days ends

// OK, now for the filtering display
echo '<div class="filters"><table><tr>';
// Global events
if($SESSION->cal_show_global) {
echo '<td class="event_global" style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
// Course events
if(!empty($SESSION->cal_show_course)) {
echo '<td class="event_course" style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
echo "</tr>\n";
if(!empty($USER->id) && !has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) {
echo '<tr>';
// Group events
if($SESSION->cal_show_groups) {
echo '<td class="event_group" style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
// User events
if($SESSION->cal_show_user) {
echo '<td class="event_user" style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
echo "</tr>\n";
}
echo '</table></div>';
// OK, now for the filtering display
echo '<div class="filters"><table><tr>';

// Global events
if($SESSION->cal_show_global) {
echo '<td class="event_global" style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}

// Course events
if(!empty($SESSION->cal_show_course)) {
echo '<td class="event_course" style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}

echo "</tr>\n";

if(!empty($USER->id) && !has_capability('moodle/legacy:guest', get_context_instance(CONTEXT_SYSTEM), 0, false)) {
echo '<tr>';
// Group events
if($SESSION->cal_show_groups) {
echo '<td class="event_group" style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
// User events
if($SESSION->cal_show_user) {
echo '<td class="event_user" style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
}
else {
echo '<td style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
}
echo "</tr>\n";
}

echo '</table></div>';
}

function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $maxevents, $courseid) {
Expand Down
4 changes: 2 additions & 2 deletions course/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ function completion_toggle(e) {
function completion_set_progressicon_visibility(spanid,displaystatus) {
// Check if the progress icon exists
if (document.getElementById(spanid)!= null) {
if (displaystatus=='show') {
if (displaystatus=='show') {
document.getElementById(spanid).style.display="block";
}
else if (displaystatus=='hide') {
document.getElementById(spanid).style.display="none";

}
else {
alert ("An error occurred when calling completion_set_progressicon_visibility() function.");
Expand Down
Loading

0 comments on commit 4454447

Please sign in to comment.