Comments (2)
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.
// 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)
- Allow events and modules in the past to automatically sync the first time. HOT 2
- Exception when running sync task - Call to a member function to_record() on boolean HOT 1
- Add read-only deleted property to user persistent HOT 1
- Enrolment failure generated for contact merge request when contacts have the same userid HOT 1
- Course welcome email not being sent HOT 1
- Add CompletionDateTime support to Registration Entity HOT 1
- Unsucessful enrolment message spams "All" site admin users. HOT 1
- Associated template issue, new events not getting added as enrolment methods HOT 1
- error/invalidpersistenterror (sourcecreated: Required field) HOT 1
- Optimise jobs running in scheduled tasks. HOT 1
- Failing unit tests: 404 errors at https://phpunit.arlo.co/api HOT 2
- DB schema misaligned: upgrade.php script does not match install.xml HOT 5
- core unit test failures due to missing privacy api on enrol_arlo_templateassociate HOT 1
- Clean up of request log can fail on large logs. Improve HOT 1
- Course welcome email field replacers first name and full name not working HOT 2
- Error messages when syncing data from Arlo platform when required connection variables not set
- External unenrol action = Disable course enrolment and remove roles causes exception
- Moodle scheduled task \enrol_arlo\task\enrolments fails
- Cron Job Failure due to Unreleased Lock
- No "Active" Events or Online Activities found. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moodle-enrol_arlo.