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
No edit summary
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 '''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
* 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
* For each entry in this table
** If it has a siteidentifier field and a corresponding entry in registry table exists
** If it has a siteidentifier field and a corresponding entry in registry table exists
*** Compare these two records below
*** Compare and update records
** Else If it has a URL field and a corresponding entry in registry table exists
** Else If it has a URL field and a corresponding entry in registry table exists
*** Compare these two records below
*** Compare and update records
** Else If it has a host field and a corresponding entry in registry table exists
** Else If it has a host field and a corresponding entry in registry table exists
*** Compare these two records below
*** Compare and update records
** Else
*** Add the MOOCH record as a new record


** If MOOCH->timemodified is larger/later than registry->timemodified then  
Function Compare_and_update_records:
*** If the email address is different:
* If MOOCH->timemodified is larger/later than registry->timemodified then  
**** Unsubscribe registry->email from Sympa
** If the email address is different:
**** Subscribe MOOCH->email to Sympa
*** Unsubscribe registry->email from Sympa
*** Update the complete registry entry with new info
*** Subscribe MOOCH->email to Sympa
** Update the complete registry entry with new info

Revision as of 08:48, 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 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 If it has a host field and a corresponding entry in registry table exists
      • Compare and update records
    • Else
      • Add the MOOCH record as a new record

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
      • Subscribe MOOCH->email to Sympa
    • Update the complete registry entry with new info