MDL-58220 oauth2: cibot cleanups

This commit is contained in:
Damyon Wiese 2017-03-24 15:34:15 +08:00
parent 99e3c347f9
commit 13b449f4a5
8 changed files with 28 additions and 23 deletions

View File

@ -131,7 +131,6 @@ class api {
* @return bool
*/
public static function send_confirm_link_login_email($userinfo, $issuer, $userid) {
$record = new stdClass();
$record->issuerid = $issuer->get('id');
$record->username = $userinfo['username'];

View File

@ -315,7 +315,7 @@ class auth extends \auth_plugin_base {
* @param string $username
* @param string $confirmsecret
*/
function user_confirm($username, $confirmsecret) {
public function user_confirm($username, $confirmsecret) {
global $DB;
$user = get_complete_user_data('username', $username);
@ -326,8 +326,8 @@ class auth extends \auth_plugin_base {
} else if ($user->secret == $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
$DB->set_field("user", "confirmed", 1, array("id"=>$user->id));
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in.
$DB->set_field("user", "confirmed", 1, array("id" => $user->id));
return AUTH_CONFIRM_OK;
}
} else {
@ -338,8 +338,8 @@ class auth extends \auth_plugin_base {
/**
* Print a page showing that a confirm email was sent with instructions.
*
* @param string title
* @param string message
* @param string $title
* @param string $message
*/
public function print_confirm_required($title, $message) {
global $PAGE, $OUTPUT, $CFG;

View File

@ -65,20 +65,20 @@ line at the top of your web browser window.
If you need help, please contact the site administrator,
{$a->admin}';
$string['confirmlinkedloginemailsubject'] = '{$a}: linked login confirmation';
$string['confirmaccountemail'] = 'Hi {$a->fullname},
A new account has been requested at \'{$a->sitename}\'
using your email address.
To confirm your new account, please go to this web address:
{$a->link}
In most mail programs, this should appear as a blue link
which you can just click on. If that doesn\'t work,
then cut and paste the address into the address
line at the top of your web browser window.
If you need help, please contact the site administrator,
$string['confirmaccountemail'] = 'Hi {$a->fullname},
A new account has been requested at \'{$a->sitename}\'
using your email address.
To confirm your new account, please go to this web address:
{$a->link}
In most mail programs, this should appear as a blue link
which you can just click on. If that doesn\'t work,
then cut and paste the address into the address
line at the top of your web browser window.
If you need help, please contact the site administrator,
{$a->admin}';
$string['confirmaccountemailsubject'] = '{$a}: account confirmation';

View File

@ -104,7 +104,8 @@ abstract class core_filetypes {
'gdoc' => array('type' => 'application/vnd.google-apps.document', 'icon' => 'document', 'groups' => array('document')),
'gsheet' => array('type' => 'application/vnd.google-apps.spreadsheet', 'icon' => 'spreadsheet',
'groups' => array('spreadsheet')),
'gslides' => array('type' => 'application/vnd.google-apps.presentation', 'icon' => 'powerpoint', 'groups' => array('presentation')),
'gslides' => array('type' => 'application/vnd.google-apps.presentation', 'icon' => 'powerpoint',
'groups' => array('presentation')),
'gif' => array('type' => 'image/gif', 'icon' => 'gif', 'groups' => array('image', 'web_image'), 'string' => 'image'),
'gtar' => array('type' => 'application/x-gtar', 'icon' => 'archive',
'groups' => array('archive'), 'string' => 'archive'),

View File

@ -64,6 +64,7 @@ abstract class rest {
* @param string $functionname
* @param array $functionargs
* @param string $rawpost Optional param to include in the body of a post.
* @return string|object
*/
public function call($functionname, $functionargs, $rawpost = false) {
$functions = $this->get_api_functions();

View File

@ -1128,7 +1128,8 @@ class file_storage {
// creating a new file from an existing alias creates new alias implicitly.
// here we just check the database consistency.
if (!empty($newrecord->repositoryid)) {
// It is OK if the current reference does not exist. It may have been altered by a repository plugin when the files where saved from a draft area.
// It is OK if the current reference does not exist. It may have been altered by a repository plugin when the files
// where saved from a draft area.
$newrecord->referencefileid = $this->get_or_create_referencefileid($newrecord->repositoryid, $newrecord->reference);
}

View File

@ -17,6 +17,8 @@
defined('MOODLE_INTERNAL') || die();
/**
* Upgrade this plugin.
*
* @param int $oldversion the version we are upgrading from
* @package repository_skydrive
* @return bool result

View File

@ -1007,6 +1007,7 @@ class repository_skydrive extends repository {
/**
* Callback to get the required scopes for system account.
*
* @param \core\oauth2\issuer $issuer
* @return string
*/
function repository_skydrive_oauth2_system_scopes(\core\oauth2\issuer $issuer) {