case 'widget': $page = new Pages_PageWidget($config, $parameters); $page->show(); break; case 'rss': $page = new Pages_PageRSS($config, $parameters); $page->show(); break; case 'embed': $embed = new Pages_EmbedFoodle($config, $parameters); $embed->getContent($_REQUEST['output']); break; case 'timezone': $db = new FoodleDBConnector($config); $timezone = new TimeZone($db); $newtimezone = $timezone->getTimezone(); echo "Timezone is :"; print var_export($newtimezone, true); break; case 'mail': require 'mail.php'; break; case 'accountmapping': $page = new Pages_PageAccountMapping($config, $parameters); $page->show(); break; case 'accountmappingprepare': $page = new Pages_PageAccountMappingPrepare($config, $parameters); $page->show(); break; case 'profile':
public function updateData($from) { $this->userid = strtolower($this->userid); $from->userid = strtolower($from->userid); if ($this->userid !== $from->userid) { throw new Exception('Trying to update user with a mismatching user id'); } $modified = FALSE; if (!empty($from->username)) { if ($this->username !== $from->username) { // error_log('username from [' . $this->username. '] to [' . $from->username . ']'); $modified = TRUE; } $this->username = $from->username; } if (!empty($from->email)) { if ($this->email !== $from->email) { // error_log('email from [' . $this->email. '] to [' . $from->email . ']'); $modified = TRUE; } $this->email = $from->email; } if (!empty($from->org)) { if ($this->org !== $from->org) { // error_log('org from [' . $this->org. '] to [' . $from->org . ']'); $modified = TRUE; } $this->org = $from->org; } if (!empty($from->orgunit)) { if ($this->orgunit !== $from->orgunit) { // error_log('orgunit from [' . $this->orgunit. '] to [' . $from->orgunit . ']'); $modified = TRUE; } $this->orgunit = $from->orgunit; } if (!empty($from->location)) { if ($this->location !== $from->location) { // error_log('location from [' . $this->location. '] to [' . $from->location . ']'); $modified = TRUE; } $this->location = $from->location; } if (!empty($from->realm)) { if ($this->realm !== $from->realm) { // error_log('Realm from [' . $this->realm. '] to [' . $from->realm . ']'); $modified = TRUE; } $this->realm = $from->realm; } if (!empty($from->idp)) { if ($this->idp !== $from->idp) { // error_log('IdP entityid from [' . $this->idp. '] to [' . $from->idp . ']'); $modified = TRUE; } $this->idp = $from->idp; } if (!empty($from->auth)) { if ($this->auth !== $from->auth) { // error_log('auth from [' . $this->auth. '] to [' . $from->auth . ']'); $modified = TRUE; } $this->auth = $from->auth; } if (!empty($from->photol)) { if ($this->photol !== $from->photol) { // error_log('photo url from [' . $this->photol. '] to [' . $from->photol . ']'); $modified = TRUE; } $this->photol = $from->photol; } // Calendar requires some special processing... if ($from->hasCalendar()) { $before = $this->getCalendar(); $this->setCalendarsExternal($from->getCalendarURLs('external')); $after = $this->getCalendar(); if ($before !== $after) { // error_log('Calendar from [' . var_export($before, TRUE). '] to [' . var_export($after, TRUE) . ']'); $modified = TRUE; } } if (empty($this->timezone)) { $timezone = new TimeZone($this->db, NULL, $this); $newtimezone = $timezone->getTimezone(); if (!empty($newtimezone)) { $this->timezone = $newtimezone; // error_log('User had no timezone set. Setting to [' . $newtimezone. ']'); $modified = TRUE; } } # echo '<pre>'; print_r($from); exit; # // error_log('User set..'); // TODO: photos // TODO: Calendar check... // Timezone not updated. // features and notidfications not updated. // Language is not updated... return $modified; }