Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Registration: Difference between revisions

From MoodleDocs
(New page: ===Logic of the registration script=== * Open ***registry*** table on moodle.org (or wherever) * Open table in the [https://docs.moodle.org/en/Development:Community_hub_-_technical_specif...)
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
===Logic of the registration script===
===Logic of the registration script===


Main logic:
* Open '''registry''' table on moodle.org (or wherever)
* Open table in the [https://docs.moodle.org/en/Development:Community_hub_-_technical_specification#Data_structure_2 hub_site_directory] table from the '''MOOCH''' database
* For each entry in this table
** If it has a siteidentifier/token field and a corresponding entry in registry table exists
*** Compare and update records
** Else If it has a URL field and a corresponding entry in registry table exists
*** Compare and update records
** Else
*** Add the MOOCH record as a new record in registry


* Open ***registry*** table on moodle.org (or wherever)
Function Compare_and_update_records:
* Open table in the [https://docs.moodle.org/en/Development:Community_hub_-_technical_specification#Data_structure_2 hub_site_directory] table from the ***MOOCH*** database
* If MOOCH->timemodified is larger/later than registry->timemodified then  
* For each entry in this table
** If the email address is different:
** If it has a siteidentifier field
*** Unsubscribe registry->email from Sympa
*** If a corresponding entry in registry table exists
*** If MOOCH->emailalert is true => Subscribe MOOCH->contactemail to Sympa
**** If the MOOCH->timemodified > registry->timemodified then  
** Else if MOOCH->alertemail is different than registry->emailalert
***** If the email address has changed, unsubscribe old and subscribe new to Sympa
*** if MOOCH->alertemail is true => Subscribe registry->emai to Sympa
***** Update the complete registry entry with new info
*** if MOOCH->alertemail is false => Unsubscribe registry->email from Sympa
** Else use the URL
** Update the complete registry entry with new info
*** If a corresponding URL exists in registry table
**** If the MOOCH->timemodified > registry->timemodified then
***** If the email address has changed, unsubscribe old and subscribe new to Sympa
***** Update the complete registry entry with new info
** Else use the hostname
*** If a corresponding entry in registry table exists
**** If the MOOCH->timemodified > registry->timemodified then
***** If the email address has changed, unsubscribe old and subscribe new to Sympa
***** Update the complete registry entry with new info
** Else it's a new one, so create a new entry in the registry table

Latest revision as of 09:13, 15 September 2010

Logic of the registration script

Main logic:

  • Open registry table on moodle.org (or wherever)
  • Open table in the hub_site_directory table from the MOOCH database
  • For each entry in this table
    • If it has a siteidentifier/token field and a corresponding entry in registry table exists
      • Compare and update records
    • Else If it has a URL field and a corresponding entry in registry table exists
      • Compare and update records
    • Else
      • Add the MOOCH record as a new record in registry

Function Compare_and_update_records:

  • If MOOCH->timemodified is larger/later than registry->timemodified then
    • If the email address is different:
      • Unsubscribe registry->email from Sympa
      • If MOOCH->emailalert is true => Subscribe MOOCH->contactemail to Sympa
    • Else if MOOCH->alertemail is different than registry->emailalert
      • if MOOCH->alertemail is true => Subscribe registry->emai to Sympa
      • if MOOCH->alertemail is false => Unsubscribe registry->email from Sympa
    • Update the complete registry entry with new info