Changed CONTEXT_SITE to CONTEXT_SYSTEM MDL-6506
[moodle.git] / userpix / index.php
index a744cfb..9e4e5e3 100644 (file)
     require_login();
 
 /// Remove the following three lines if you want everyone to access it
-    if (!isadmin()) {
-        error("Currently only the administrator can access this page!");
-    }
+    require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
 
-    
     if (!$users = get_records("user", "picture", "1", "lastaccess DESC", "id,firstname,lastname")) {
         error("no users!");
     }