Code Monkey home page Code Monkey logo

Comments (2)

fentosi avatar fentosi commented on June 12, 2024

Hi Troy,

We discussed and it really depends on what happens when a user deletes and reinstall it the plugin, connected to the same platform. We assume it will only delete the Arlo related data.

We suggest to do a check if a given user can connect to a given platform, if yes, lock the platform name (user won't be able to change it). In this case the only way to change the platform name is to delete the plugin and reinstall it. In case the user misstypes the platformname, the connection check would fail and the user will be able to change it (in this case there is no synced data)

What do you think?

from moodle-enrol_arlo.

troywilliams avatar troywilliams commented on June 12, 2024

@Chocolate-lightning
FYI

// New method in enrol plugin.
enrol_arlo_plugin->change_platform($oldplatform, $newplatform)
if ($oldplatform == $newplatform) {
   return;
}
$rs = $DB->get_recordset('enrol', array('enrol' => 'arlo'));
foreach ($rs as $instance) {
    $this->delete_instance($instance);
}
$rs->close();
role_unassign_all(array('component' => 'enrol_arlo'));
// Clear any create password flags.
$DB->delete_records('user_preferences', array('name' => 'enrol_arlo_createpassword'));
// Clear out tables.
$DB->delete_records('enrol_arlo_collection', array('platform' =>$oldplatform));
$DB->delete_records('enrol_arlo_contact', array('platform' =>$oldplatform));
$DB->delete_records('enrol_arlo_contact', array('event' =>$oldplatform));
e.t.c
// Finally purge all caches.
purge_all_caches();

from moodle-enrol_arlo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.