Skip to content

Commit

Permalink
#37 - 401 - CLI: remove deprecation from cron_setup_user()
Browse files Browse the repository at this point in the history
  • Loading branch information
jpahullo committed Jun 3, 2024
1 parent b247eae commit 87b481e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cli/sync_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
define('CLI_SCRIPT', true);

require(__DIR__.'/../../../config.php');
global $CFG, $DB;
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/clilib.php');
require_once($CFG->dirroot . '/local/cohortauto/lib.php');
Expand All @@ -34,7 +35,7 @@
* checking permissions and complaining when a bare script doesn't have any.
* So for the purposes of synchronising users, we're an admin user.
*/
cron_setup_user(get_admin());
\core\cron::setup_user(get_admin());

$username = cli_input('Synchronise cohorts for username:');

Expand Down
3 changes: 2 additions & 1 deletion cli/sync_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
define('CLI_SCRIPT', true);

require(__DIR__.'/../../../config.php');
global $CFG, $DB;
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/clilib.php');
require_once($CFG->dirroot . '/local/cohortauto/lib.php');
Expand All @@ -34,7 +35,7 @@
* checking permissions and complaining when a bare script doesn't have any.
* So for the purposes of synchronising users, we're an admin user.
*/
cron_setup_user(get_admin());
\core\cron::setup_user(get_admin());

$handler = new local_cohortauto_handler();
$users = $DB->get_recordset('user', array('deleted' => 0));
Expand Down

0 comments on commit 87b481e

Please sign in to comment.