Comparing revisions for AutomaticUserPageCreation

Additions:
Based on a request in the SuggestionBox, this code will automatically create the page of a newly registered user. Therefore it uses another page, you can choose, as template.
Note that this needs some testing, for example it will surely fail, if you don't give the user the right to load (view?) the template-page.
$from = $this->GetConfigValue('userpagetemplate');
$note = 'automatic creation';
$thepage=$this->LoadPage($from); # load the source page
if ($thepage) $pagecontent = $thepage['body']; # get its content
$this->SavePage($name, $pagecontent, $note); #create target page
~~~&Yes, I definitely agree that on registration, the user should be redirected to WelcomeUser (which might also contain a dynamic welcome message like: //Hi, {{who}}//). -- DarTar
Deletions:
Based on a request in the SuggestionBox, this code will automatically create the page of a newly registered user. Therefore it uses another page, you can choose, as template.
Note that this needs some testing, for example it will surely fail, if you don't give the user the right to load (view?) the template-page.
The user is redirected to WelcomeUser after registration. If you don't want that, just delete the //$this->Redirect(WelcomeUser);// line after inserting the code.
$from = $this->GetConfigValue('userpagetemplate');
$note = 'automatic creation';
$thepage=$this->LoadPage($from); # load the source page
if ($thepage) $pagecontent = $thepage['body']; # get its content
$this->SavePage($name, $pagecontent, $note); #create target page
$this->Redirect(WelcomeUser);
~~&How about a short "who" action without you are? Do actions work in headers? --NilsLindenberg
~~~&Yes, I definitely agree that on registration, the user should be redirected to WelcomeUser (which might also contain a dynamic welcome message like: Hi, {{who}}). -- DarTar
~~~~&DarTar, Eggzakly! :) -- JavaWoman
~~~&Well, this is the case now. Except from the dynamic message. That is something the admin of a wiki has to/can do :) --NilsLindenberg
~~~~&Nils, look at the **code** DarTar used here - one of the "little actions" is all that's needed - which will quite likely be included in the //next// version (after 1.1.6.0) Wikka release :) -- JavaWoman
~~~~~&I know that. But it is to the admin of a wiki, if he includes such thing into the template-page, or not. Not of the user-registration :) --NilsLindenberg
~~~~~~&Oh, I see what you mean now, Nils. The idea was to include such a "dynamic welcome" in the WelcomeUser page though - where it would be just the action. But then we'd have to create such a page on an install - for now it's only here... Hmmm. --JavaWoman
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki