redirect ($returnurl);
-?>
+
$fieldname = get_string('webpage');
} else {
$fieldname = get_string($fieldname);
- }
+ }
if ($retrieveopts) {
$varname = 'field_map_' . $field;
-<?PHP // $Id$
+<?php
// block.php - allows admin to edit all local configuration variables for a block
echo '</form>';
echo $OUTPUT->footer();
-?>
+
-<?PHP // $Id$
+<?php
// Allows the admin to configure blocks (hide/show, delete and configure)
echo $OUTPUT->footer();
-?>
+
-<?php /// $Id$
+<?php
/// Create "blog" forums in each course and copy blog entries from these courses' participants in these forums
require_once('../config.php');
/// version of PHP compiled for CGI.
///
/// eg wget -q -O /dev/null 'http://moodle.somewhere.edu/admin/cron.php'
-/// or php /web/moodle/admin/cron.php
+/// or php /web/moodle/admin/cron.php
set_time_limit(0);
$starttime = microtime();
/// check if execution allowed
if (isset($_SERVER['REMOTE_ADDR'])) { // if the script is accessed via the web.
- if (!empty($CFG->cronclionly)) {
+ if (!empty($CFG->cronclionly)) {
// This script can only be run via the cli.
print_error('cronerrorclionly', 'admin');
exit;
$pass = optional_param('password', '', PARAM_RAW);
if($pass != $CFG->cronremotepassword) {
// wrong password.
- print_error('cronerrorpassword', 'admin');
+ print_error('cronerrorpassword', 'admin');
exit;
}
}
if (file_exists($blockfile)) {
require_once($blockfile);
$classname = 'block_'.$block->name;
- $blockobj = new $classname;
+ $blockobj = new $classname;
if (method_exists($blockobj,'cron')) {
mtrace("Processing cron function for ".$block->name.'....','');
if ($blockobj->cron()) {
}
}
mtrace("Finished quiz reports");
-
+
mtrace('Starting admin reports');
// Admin reports do not have a database table that lists them. Instead a
// report includes cron.php with function report_reportname_cron() if it wishes
}
/// Run all core cron jobs, but not every time since they aren't too important.
-/// These don't have a timer to reduce load, so we'll use a random number
+/// These don't have a timer to reduce load, so we'll use a random number
/// to randomly choose the percentage of times we should run these jobs.
srand ((double) microtime() * 10000000);
mtrace('Synchronised metacourses');
//
- // generate new password emails for users
+ // generate new password emails for users
//
mtrace('checking for create_password');
if ($DB->count_records('user_preferences', array('name'=>'create_password', 'value'=>'1'))) {
mtrace('creating passwords for new users');
- $newusers = $DB->get_records_sql("SELECT u.id as id, u.email, u.firstname,
+ $newusers = $DB->get_records_sql("SELECT u.id as id, u.email, u.firstname,
u.lastname, u.username,
- p.id as prefid
- FROM {user} u
+ p.id as prefid
+ FROM {user} u
JOIN {user_preferences} p ON u.id=p.userid
WHERE p.name='create_password' AND p.value='1' AND u.email !='' ");
foreach ($newusers as $newuserid => $newuser) {
$newuser->emailstop = 0; // send email regardless
- // email user
+ // email user
if (setnew_password_and_mail($newuser)) {
// remove user pref
$DB->delete_records('user_preferences', array('id'=>$newuser->prefid));
}
}
}
-
+
if (!empty($CFG->usetags)) {
require_once($CFG->dirroot.'/tag/lib.php');
tag_cron();
mtrace ('Executed tag cron');
}
-
+
// Accesslib stuff
cleanup_contexts();
mtrace ('Cleaned up contexts');
gc_cache_flags();
mtrace ('Cleaned cache flags');
// If you suspect that the context paths are somehow corrupt
- // replace the line below with: build_context_path(true);
+ // replace the line below with: build_context_path(true);
build_context_path();
mtrace ('Built context paths');
@set_time_limit(0);
@raise_memory_limit("192M");
if (function_exists('apache_child_terminate')) {
- // if we are running from Apache, give httpd a hint that
- // it can recycle the process after it's done. Apache's
+ // if we are running from Apache, give httpd a hint that
+ // it can recycle the process after it's done. Apache's
// memory management is truly awful but we can help it.
@apache_child_terminate();
}
include_once("$CFG->dirroot/backup/backuplib.php");
include_once("$CFG->dirroot/backup/lib.php");
mtrace("Running backups if required...");
-
+
if (! schedule_backup_cron()) {
mtrace("ERROR: Something went wrong while performing backup tasks!!!");
} else {
// run gradebook import/export/report cron
if ($gradeimports = get_plugin_list('gradeimport')) {
- foreach ($gradeimports as $gradeimport => $plugindir) {
+ foreach ($gradeimports as $gradeimport => $plugindir) {
if (file_exists($plugindir.'/lib.php')) {
require_once($plugindir.'/lib.php');
- $cron_function = 'grade_import_'.$gradeimport.'_cron';
+ $cron_function = 'grade_import_'.$gradeimport.'_cron';
if (function_exists($cron_function)) {
mtrace("Processing gradebook import function $cron_function ...", '');
- $cron_function;
+ $cron_function;
}
}
- }
+ }
}
if ($gradeexports = get_plugin_list('gradeexport')) {
- foreach ($gradeexports as $gradeexport => $plugindir) {
+ foreach ($gradeexports as $gradeexport => $plugindir) {
if (file_exists($plugindir.'/lib.php')) {
require_once($plugindir.'/lib.php');
- $cron_function = 'grade_export_'.$gradeexport.'_cron';
+ $cron_function = 'grade_export_'.$gradeexport.'_cron';
if (function_exists($cron_function)) {
mtrace("Processing gradebook export function $cron_function ...", '');
- $cron_function;
+ $cron_function;
}
}
}
}
if ($gradereports = get_plugin_list('gradereport')) {
- foreach ($gradereports as $gradereport => $plugindir) {
+ foreach ($gradereports as $gradereport => $plugindir) {
if (file_exists($plugindir.'/lib.php')) {
require_once($plugindir.'/lib.php');
- $cron_function = 'grade_report_'.$gradereport.'_cron';
+ $cron_function = 'grade_report_'.$gradereport.'_cron';
if (function_exists($cron_function)) {
mtrace("Processing gradebook report function $cron_function ...", '');
- $cron_function;
+ $cron_function;
}
}
}
}
-
+
// Run external blog cron if needed
if ($CFG->useexternalblogs) {
require_once($CFG->dirroot . '/blog/lib.php');
mtrace("Fetching external blog entries...", '');
$sql = "timefetched < ? - ? OR timefetched = 0";
$externalblogs = $DB->get_records_select('blog_external', $sql, array(mktime(), $CFG->externalblogcrontime));
-
+
foreach ($external_blogs as $eb) {
blog_sync_external_entries($eb);
}
mtrace("Cron script completed correctly");
$difftime = microtime_diff($starttime, microtime());
- mtrace("Execution took ".$difftime." seconds");
+ mtrace("Execution took ".$difftime." seconds");
/// finish the IE hack
if (check_browser_version('MSIE')) {
throw new dbtransfer_exception('notargetconectexception', null, "$CFG->wwwroot/$CFG->admin/dbtransfer/");
}
if ($targetdb->get_tables()) {
- throw new dbtransfer_exception('targetdatabasenotempty', null, "$CFG->wwwroot/$CFG->admin/dbtransfer/");
+ throw new dbtransfer_exception('targetdatabasenotempty', null, "$CFG->wwwroot/$CFG->admin/dbtransfer/");
}
// Start output.
if (empty($sure)) {
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey());
-
+
$formcontinue = html_form::make_button('delete.php', $optionsyes, get_string('yes'));
$formcancel = html_form::make_button('index.php', null, get_string('no'), 'get');
echo $OUTPUT->confirm('Are you completely sure you want to delete everything inside the directory '. $deletedir .' ?', $formcontinue, $formcancel);
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey(), 'reallysure'=>'yes');
$formcontinue = html_form::make_button('delete.php', $optionsyes, get_string('yes'));
$formcancel = html_form::make_button('index.php', null, get_string('no'), 'get');
- echo $OUTPUT->confirm('Are you REALLY REALLY completely sure you want to delete everything inside the directory '.
- $deletedir .' (this includes all user images, and any other course files that have been created) ?',
+ echo $OUTPUT->confirm('Are you REALLY REALLY completely sure you want to delete everything inside the directory '.
+ $deletedir .' (this includes all user images, and any other course files that have been created) ?',
$formcontinue, $formcancel);
echo $OUTPUT->footer();
exit;
echo '<input type="hidden" name="savesettings" value="1" />';
echo '<fieldset>';
echo '<div class="form-item clearfix" id="admin-sendcoursewelcomemessage">';
-
+
echo '<div class="form-label"><label for = "menusendcoursewelcomemessage">' . get_string('sendcoursewelcomemessage', 'admin');
echo '<span class="form-shortname">sendcoursewelcomemessage</span>';
echo '</label></div>';
-<?PHP // $Id$
+<?php
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
echo $OUTPUT->footer();
exit;
-?>
+
/// Handle the 'updatecomponent' action
if ($action == 'updatecomponent' && confirm_sesskey()) {
/// Create component installer and execute it
- if ($cd = new component_installer('http://download.moodle.org',
- 'environment',
+ if ($cd = new component_installer('http://download.moodle.org',
+ 'environment',
'environment.zip')) {
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
switch ($status) {
$title = get_string('deletefilterareyousure', 'admin', $filtername);
admin_externalpage_print_header();
echo $OUTPUT->heading($title);
-
+
$linkcontinue = new moodle_url($returnurl, array('action' => 'delete', 'filterpath' => $filterpath, 'confirm' => 1));
$formcancel = html_form::make_button($returnurl, null, get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('deletefilterareyousuremessage', 'admin', $filtername), $linkcontinue, $formcancel);
global $CFG;
$this->starttime = time()+microtime();
-
+
$arguments = array(
array('short'=>'u', 'long'=>'username',
'help' => 'Your moodle username', 'type'=>'STRING', 'default' => ''),
$eventdata->fullmessage = $body;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = '';
- $eventdata->smallmessage = '';
+ $eventdata->smallmessage = '';
events_trigger('message_send', $eventdata);
}
}
}
function exists() {
global $DB;
- $positionexpr = $DB->sql_position($DB->sql_concat("','", "q.id", "','"),
+ $positionexpr = $DB->sql_position($DB->sql_concat("','", "q.id", "','"),
$DB->sql_concat("','", "qma.sequence", "','"));
return $DB->record_exists_sql("
SELECT * FROM {question} q
echo $OUTPUT->footer();
}
-?>
+
if ($preview_url) {
$link = html_link::make($preview_url, get_string('preview'));
$link->add_action(new popup_action('click', $link->url));
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
}
echo '</fieldset>';
}
if ($preview_url) {
$link = html_link::make($preview_url, get_string('preview'));
$link->add_action(new popup_action('click', $link->url));
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
}
echo '</fieldset>';
}
if ($preview_url) {
$link = html_link::make($preview_url, get_string('preview'));
$link->add_action(new popup_action('click', $link->url));
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
}
echo '</fieldset>';
}
-<?php //$Id$
+<?php
///This file only manages the installation of 1.6 lang packs.
///in downloads.moodle.org, they are store in separate directory /lang16
///in local server, they are stored in $CFG->dataroot/lang
return false;
}
}
-?>
+
* - Run your admin/cron.php
*
* - Read /tmp/moodle-mailout.log
- *
+ *
*
* This script will create logfiles in /tmp/ or in $TMPDIR if set.
* On windows, use php -r 'print sys_get_temp_dir()' to see where the file is saved.
<input type="hidden" name="step" value="<?php echo $mnet_peer->nextstep; ?>" />
<input type="hidden" name="hostid" value="<?php echo ($mnet_peer->id)? $mnet_peer->id : '0' ; ?>" />
<table cellpadding="9" cellspacing="0" >
-<?php
+<?php
foreach($myservices as $name => $versions) {
$version = current($versions);
?>
} else {
$versionstring = '';
}
-
+
echo $breakstring;
?>
<input type="hidden" name="exists[<?php echo $version['serviceid']; ?>]" value="1" />
<input type="hidden" name="publish[<?php echo $version['serviceid']; ?>]" value="0" />
<?php } else { ?>
<input type="checkbox" name="publish[<?php echo $version['serviceid']; ?>]" <?php echo (!empty($version['I_publish']))? 'checked="checked" ': '' ; ?>/>
-<?php
+<?php
print_string('publish','mnet');
- echo $versionstring;
- if (!empty($version['hostsubscribes'])) {
- echo '<a href="#" title="'.get_string('issubscribed','mnet', $mnet_peer->name).'">√</a> ';
+ echo $versionstring;
+ if (!empty($version['hostsubscribes'])) {
+ echo '<a href="#" title="'.get_string('issubscribed','mnet', $mnet_peer->name).'">√</a> ';
}
- if (!empty($version['allhosts_publish'])) {
+ if (!empty($version['allhosts_publish'])) {
print_string("enabled_for_all",'mnet',!empty($version['I_publish']));
- }
+ }
echo '<br />';
} ?>
<input type="checkbox" name="subscribe[<?php echo $version['serviceid']; ?>]" <?php echo (!empty($version['I_subscribe']))? 'checked="checked" ': '' ; ?>/>
-<?php
+<?php
print_string('subscribe','mnet');
- echo $versionstring;
- if (!empty($version['hostpublishes'])) {
+ echo $versionstring;
+ if (!empty($version['hostpublishes'])) {
echo '<a href="#" title="'.get_string('ispublished','mnet', $mnet_peer->name).'">√</a> ';
- }
+ }
if (!empty($version['allhosts_subscribe'])) {
print_string("enabled_for_all",'mnet',!empty($version['I_subscribe']));
}
-
- echo '<br />';
+
+ echo '<br />';
$breakstring = '. . . . . . . . . . . . . . . . . . . . . . . . <br>';
} // end foreach
?>
$tabs[] = new tabobject('mnetthemes', 'mnet_themes.php?step=list&hostid='.$mnet_peer->id, $strmnetthemes, $strmnetthemes, false);
if ($mnet_peer->id != $CFG->mnet_all_hosts_id) {
$tabs[] = new tabobject('mnetlog', $logurl, $strmnetlog, $strmnetlog, false);
-}
+}
print_tabs(array($tabs), 'mnetthemes');
$readme = '<li>'.
$link = html_link::make($CFG->themewww .'/'. $theme .'/README.html', $strinfo);
$link->add_action(new popup_action('click', $link->url, $theme, array('height' => 400, 'width' => 500)));
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
} else if (file_exists($CFG->themedir.'/'.$theme.'/README.txt')) {
$readme = '<li>'.
$link = html_link::make($CFG->themewww .'/'. $theme .'/README.txt', $strinfo);
$link->add_action(new popup_action('click', $link->url, $theme, array('height' => 400, 'width' => 500)));
- echo $OUTPUT->link($link);
+ echo $OUTPUT->link($link);
}
if (file_exists("$theme/screenshot.png")) {
$screenshotpath = "$theme/screenshot.png";
<tr>
<th class="header c0" colspan="2"><?php print_string('testtrustedhosts', 'mnet'); ?></th>
</tr>
-<?php
+<?php
if (!empty($test_ip_address)){
?>
<tr>
<td class="cell c1" colspan="2"><?php print_string('testtrustedhostsexplain', 'mnet'); ?></td>
</tr>
<?php
- }
+ }
?>
<tr>
<td class="cell c1" colspan="2">
-<?PHP // $Id$
+<?php
// Allows the admin to manage activity modules
require_once('../config.php');
echo $OUTPUT->footer();
-?>
+
-<?php /// $Id$
+<?php
/// Search and replace strings throughout all texts in the whole database
require_once('../config.php');
}
return $return;
}
-?>
+
FROM {course_modules} cm, {assignment} a
WHERE cm.id = ? AND cm.module = ? AND
cm.instance = a.id AND a.assignmenttype = 'online'";
- $params = array($instance, $aid);
+ $params = array($instance, $aid);
/// if record exists then we need to move instance to it's correct section
if ($DB->record_exists_sql($sql, $params)) {
-<?PHP // $Id$
+<?php
// phpinfo.php - shows phpinfo for the current server
require_once("../config.php");
echo $OUTPUT->footer();
-?>
+
redirect($baseurl);
}
echo $OUTPUT->footer();
-?>
+
if (!validate_email($user->email)) {
die();
}
-
+
$site = get_site();
$subject = get_string('noreplybouncesubject','moodle',format_string($site->fullname));
$body = get_string('noreplybouncemessage','moodle',format_string($site->fullname))."\n\n";
-
+
$fd = fopen('php://stdin','r');
if ($fd) {
while(!feof($fd)) {
}
fclose($fd);
}
-
+
$user->id = 0; // to prevent anything annoying happening
-
+
$from->firstname = null;
$from->lastname = null;
$from->email = '<>';
$from->maildisplay = true;
-
+
email_to_user($user,$from,$subject,$body);
die ();
}
$function = $modname.'_process_email';
if (!function_exists($function)) {
- die();
+ die();
}
$fd = fopen('php://stdin','r');
if (!$fd) {
$body .= fgets($fd);
}
-$function($modargs,$body);
+$function($modargs,$body);
fclose($fd);
-<?PHP // $Id$
+<?php
// Allows the admin to manage question types.
require_once(dirname(__FILE__) . '/../config.php');
$html .= '</div></form>';
return $html;
}
-?>
+
-<?php // $Id$
+<?php
// register.php - allows admin to register their site on moodle.org
require_once('../config.php');
-<?php /// $Id$
+<?php
/// Search and replace strings throughout all texts in the whole database
require_once('../config.php');
echo $OUTPUT->footer();
-?>
+
-<?php // $Id$
+<?php
// searches for admin settings
echo $OUTPUT->footer();
-?>
+
if (empty($SITE->fullname)) {
$PAGE->set_title($settingspage->visiblename);
$PAGE->set_heading($settingspage->visiblename);
-
+
echo $OUTPUT->header();
echo $OUTPUT->box(get_string('configintrosite', 'admin'));
if (!is_numeric($zone)) {
//not a path, but it looks like it anyway
$zone = clean_param($zone, PARAM_PATH);
- }
+ }
require_login();
$PAGE->set_heading($strtimezone);
$PAGE->navbar->add($strtimezone);
echo $OUTPUT->header();
-
+
echo $OUTPUT->heading("");
if (data_submitted() and !empty($zone) and confirm_sesskey()) {
<?php
// Automatic update of Timezones from a new source
-
+
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/filelib.php');
require_once($CFG->libdir.'/olson.php');
-
+
admin_externalpage_setup('timezoneimport');
$ok = optional_param('ok', 0, PARAM_BOOL);
-<?php // $Id$
+<?php
// detects settings that were added during an upgrade, displays a screen for the admin to
// modify them, and then processes modifications
echo $OUTPUT->footer();
-?>
+
define ('PIX_FILE_UPDATED', 0);
define ('PIX_FILE_ERROR', 1);
-define ('PIX_FILE_SKIPPED', 2);
-
+define ('PIX_FILE_SKIPPED', 2);
+
admin_externalpage_setup('uploadpictures');
require_login();
if (function_exists('apache_child_terminate')) {
@apache_child_terminate();
}
-
+
// Create a unique temporary directory, to process the zip file
// contents.
$zipodir = my_mktempdir($CFG->dataroot.'/temp/', 'usrpic');
$dstfile = $zipodir.'/images.zip';
-
+
if (!$mform->save_file('userfile', $dstfile, true)) {
echo $OUTPUT->notification(get_string('uploadpicture_cannotmovezip','admin'));
@remove_dir($zipdir);
// We don't need the zip file any longer, so delete it to make
// it easier to process the rest of the files inside the directory.
@unlink($dstfile);
-
+
$results = array ('errors' => 0,'updated' => 0);
process_directory($zipdir, $userfields[$userfield], $overwritepicture, $results);
-
+
// Finally remove the temporary directory with all the user images and print some stats.
remove_dir($zipdir);
echo $OUTPUT->notification(get_string('usersupdated', 'admin') . ": " . $results['updated']);
*/
function process_file ($file, $userfield, $overwrite) {
global $DB, $OUTPUT;
-
+
// Add additional checks on the filenames, as they are user
// controlled and we don't want to open any security holes.
$path_parts = pathinfo(cleardoubleslashes($file));
* picture file to.
* @param string $originalfile the full path of the picture file.
*
- * @return bool
+ * @return bool
*/
function my_save_profile_image($id, $originalfile) {
$destination = create_profile_image_destination($id, 'user');
class admin_uploadpicture_form extends moodleform {
function definition (){
global $CFG, $USER;
-
+
$mform =& $this->_form;
-
+
$this->set_upload_manager(new upload_manager('userpicturesfile', false, false, null, false, 0, true, true, false));
-
+
$mform->addElement('header', 'settingsheader', get_string('upload'));
-
+
$mform->addElement('file', 'userpicturesfile', get_string('file'), 'size="40"');
$mform->addRule('userpicturesfile', null, 'required');
$choices = array( 0 => get_string('no'), 1 => get_string('yes') );
$mform->addElement('select', 'overwritepicture', get_string('uploadpicture_overwrite', 'admin'), $choices);
$mform->setType('overwritepicture', PARAM_INT);
-
+
$this->add_action_buttons(false, get_string('uploadpictures', 'admin'));
}
}
-<?php // $Id$
+<?php
require_once $CFG->libdir.'/formslib.php';
class admin_uploaduser_form1 extends moodleform {
return $errors;
}
}
-?>
+
// create the user filter form
$ufiltering = new user_filtering();
admin_externalpage_print_header();
-
+
// Carry on with the user listing
$columns = array("firstname", "lastname", "email", "city", "country", "lastaccess");
$alphabet = explode(',', get_string('alphabet'));
$strall = get_string('all');
-
+
$baseurl = new moodle_url('user.php', array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage));
echo $OUTPUT->paging_bar(moodle_paging_bar::make($usercount, $page, $perpage, $baseurl));
($CFG->fullnamedisplay == 'firstname') or
($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'firstname lastname' )) {
$fullnamedisplay = "$firstname / $lastname";
- } else { // ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'lastname firstname')
+ } else { // ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'lastname firstname')
$fullnamedisplay = "$lastname / $firstname";
}