]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19972 reverting the previous commit
authormudrd8mz <mudrd8mz>
Thu, 30 Jul 2009 15:16:53 +0000 (15:16 +0000)
committermudrd8mz <mudrd8mz>
Thu, 30 Jul 2009 15:16:53 +0000 (15:16 +0000)
Petr does not agree with adding this new function before require_login() and friends are re-thinked.

lib/moodlelib.php

index 687a3222344b17f5c2d5f009b8c76e4de977dc5d..826741a8e5fa2177a5ca905ca12ffb0f3886bf72 100644 (file)
@@ -2231,17 +2231,6 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null, $setwantsu
 }
 
 
-/**
- * Prints error if the user is logged in as guest user with username 'guest'.
- *
- * @return void
- */
-function require_real_user($user=NULL) {
-    if (isguestuser($user)) {
-        print_error('guestsarenotallowed');
-    }
-}
-
 /**
  * This function just makes sure a user is logged out.
  *
@@ -7671,7 +7660,7 @@ function shorten_text($text, $ideal=30, $exact = false, $ending='...') {
     // if the words shouldn't be cut in the middle...
     if (!$exact) {
         // ...search the last occurance of a space...
-               for ($k=strlen($truncate);$k>0;$k--) {
+        for ($k=strlen($truncate);$k>0;$k--) {
             if (!empty($truncate[$k]) && ($char = $truncate[$k])) {
                 if ($char == '.' or $char == ' ') {
                     $breakpos = $k+1;
@@ -7681,23 +7670,23 @@ function shorten_text($text, $ideal=30, $exact = false, $ending='...') {
                     break;                        // character boundary.
                 }
             }
-               }
+        }
 
-               if (isset($breakpos)) {
+        if (isset($breakpos)) {
             // ...and cut the text in this position
             $truncate = substr($truncate, 0, $breakpos);
-               }
-       }
+        }
+    }
 
     // add the defined ending to the text
-       $truncate .= $ending;
+    $truncate .= $ending;
 
     // close all unclosed html-tags
     foreach ($open_tags as $tag) {
         $truncate .= '</' . $tag . '>';
     }
 
-       return $truncate;
+    return $truncate;
 }