+ public function update($dataObject=false)
+ {
+ // Whenever the User_group is updated, find the Local_group
+ // and update its nickname too.
+ if ($this->nickname != $dataObject->nickname) {
+ $local = Local_group::getKV('group_id', $this->id);
+ if ($local instanceof Local_group) {
+ common_debug("Updating Local_group ({$this->id}) nickname from {$dataObject->nickname} to {$this->nickname}");
+ $local->setNickname($this->nickname);
+ }
+ }
+
+ // Also make sure the Profile table is up to date!
+ $fields = array(/*group field => profile field*/
+ 'nickname' => 'nickname',
+ 'fullname' => 'fullname',
+ 'mainpage' => 'profileurl',
+ 'homepage' => 'homepage',
+ 'description' => 'bio',
+ 'location' => 'location',
+ 'created' => 'created',
+ 'modified' => 'modified',
+ );
+ $profile = $this->getProfile();
+ $origpro = clone($profile);
+ foreach ($fields as $gf=>$pf) {
+ $profile->$pf = $this->$gf;