Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 108... Línea 108...
108
     *
108
     *
109
     * @param \csv_import_reader $cir
109
     * @param \csv_import_reader $cir
110
     * @param string|null $progresstrackerclass
110
     * @param string|null $progresstrackerclass
111
     * @throws \coding_exception
111
     * @throws \coding_exception
112
     */
112
     */
113
    public function __construct(\csv_import_reader $cir, string $progresstrackerclass = null) {
113
    public function __construct(\csv_import_reader $cir, ?string $progresstrackerclass = null) {
114
        $this->cir = $cir;
114
        $this->cir = $cir;
115
        if ($progresstrackerclass) {
115
        if ($progresstrackerclass) {
116
            if (!class_exists($progresstrackerclass) || !is_subclass_of($progresstrackerclass, \uu_progress_tracker::class)) {
116
            if (!class_exists($progresstrackerclass) || !is_subclass_of($progresstrackerclass, \uu_progress_tracker::class)) {
117
                throw new \coding_exception('Progress tracker class must extend \uu_progress_tracker');
117
                throw new \coding_exception('Progress tracker class must extend \uu_progress_tracker');
118
            }
118
            }
Línea 908... Línea 908...
908
                    // Save custom profile fields data from csv file.
908
                    // Save custom profile fields data from csv file.
909
                    profile_save_data($existinguser);
909
                    profile_save_data($existinguser);
910
                }
910
                }
Línea 911... Línea 911...
911
 
911
 
912
                if ($this->get_bulk() == UU_BULK_UPDATED or $this->get_bulk() == UU_BULK_ALL) {
912
                if ($this->get_bulk() == UU_BULK_UPDATED or $this->get_bulk() == UU_BULK_ALL) {
913
                    if (!in_array($user->id, $SESSION->bulk_users)) {
913
                    if (!array_key_exists($user->id, $SESSION->bulk_users)) {
914
                        $SESSION->bulk_users[] = $user->id;
914
                        $SESSION->bulk_users[$user->id] = $user->id;
915
                    }
915
                    }
Línea 916... Línea 916...
916
                }
916
                }
917
 
917
 
Línea 922... Línea 922...
922
                // No user information changed.
922
                // No user information changed.
923
                $this->upt->track('status', get_string('useraccountuptodate', 'tool_uploaduser'));
923
                $this->upt->track('status', get_string('useraccountuptodate', 'tool_uploaduser'));
924
                $this->usersuptodate++;
924
                $this->usersuptodate++;
Línea 925... Línea 925...
925
 
925
 
926
                if ($this->get_bulk() == UU_BULK_ALL) {
926
                if ($this->get_bulk() == UU_BULK_ALL) {
927
                    if (!in_array($user->id, $SESSION->bulk_users)) {
927
                    if (!array_key_exists($user->id, $SESSION->bulk_users)) {
928
                        $SESSION->bulk_users[] = $user->id;
928
                        $SESSION->bulk_users[$user->id] = $user->id;
929
                    }
929
                    }
930
                }
930
                }
Línea 931... Línea 931...
931
            }
931
            }
932
 
932
 
933
            if ($dologout) {
933
            if ($dologout) {
Línea 934... Línea 934...
934
                \core\session\manager::kill_user_sessions($existinguser->id);
934
                \core\session\manager::destroy_user_sessions($existinguser->id);
935
            }
935
            }
936
 
936
 
Línea 1057... Línea 1057...
1057
 
1057
 
1058
            // Make sure user context exists.
1058
            // Make sure user context exists.
Línea 1059... Línea 1059...
1059
            \context_user::instance($user->id);
1059
            \context_user::instance($user->id);
1060
 
1060
 
1061
            if ($this->get_bulk() == UU_BULK_NEW or $this->get_bulk() == UU_BULK_ALL) {
1061
            if ($this->get_bulk() == UU_BULK_NEW or $this->get_bulk() == UU_BULK_ALL) {
1062
                if (!in_array($user->id, $SESSION->bulk_users)) {
1062
                if (!array_key_exists($user->id, $SESSION->bulk_users)) {
1063
                    $SESSION->bulk_users[] = $user->id;
1063
                    $SESSION->bulk_users[$user->id] = $user->id;
1064
                }
1064
                }
Línea 1065... Línea 1065...
1065
            }
1065
            }