From: Chip R. <ch...@un...> - 2003-01-13 08:05:40
|
I'm using phpwiki-1.3.4. I have ALLOW_USER_LOGIN true, ALLOW_BOGO_LOGIN false, and REQUIRE_SIGNIN_BEFORE_EDIT true. How can the administrative user create user logins? -- Chip Rosenthal * ch...@un... * http://www.unicom.com/ "Why look back in anguish when we can look forward to the future with cynicism?" * http://www.unicom.com/chrome/a/000029.html |
From: Jochen K. <Jo...@Ka...> - 2003-01-13 19:56:29
Attachments:
phpwiki-UserManagement-v1.zip
|
Chip Rosenthal wrote: > > I'm using phpwiki-1.3.4. I have ALLOW_USER_LOGIN true, ALLOW_BOGO_LOGIN > false, and REQUIRE_SIGNIN_BEFORE_EDIT true. > > How can the administrative user create user logins? This is not possible with the actual version..., If you do the following patches then it works. Then you have the following features: - User can register him/herself. The user must enter an valid E-Mail account to receive the password (you can also disable this at the moment by removing the plugin: UserRegister.php from the attached zip-file) - Authenticated users can upload files (only. zip, pdf, jpg, gif, png, txt) and link to them in any wiki-page - Administrators can create user accounts (an automatic email is sent to the user if you want) All this you can test on: http://wiki.kalmbachnet.de/ Greetings Jochen PS: The follwoing files are new: - lib/plugin/UserAdminCreateUser.php - lib/plugin/UserRegister.php - lib/plugin/UserFileManagement.php - pgsrc/AdminCreateUser - pgsrc/UserRegister The following patches are needed (all included in the attached file): Index: config.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v retrieving revision 1.68 diff -r1.68 config.php 260c260,266 < if (!defined('DATA_PATH')) define('DATA_PATH', dirname(SCRIPT_NAME)); --- > if (!defined('DATA_PATH')) { > $temp = dirname(SCRIPT_NAME); > if ( ($temp == '/') || ($temp == '\\') ) > $temp = ""; > define('DATA_PATH', $temp); > } > Index: display.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/display.php,v retrieving revision 1.38 diff -r1.38 display.php 66a67,70 > > header("Cache-Control: no-cache, must-revalidate"); > header("Expires: 0"); > 135a140,143 > > header("Cache-Control: no-cache, must-revalidate"); > header("Expires: 0"); > Index: Request.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/Request.php,v retrieving revision 1.24 diff -r1.24 Request.php 331a332,335 > > function move($dest) { > return move_uploaded_file($this->_info['tmp_name'], $dest); > } Index: stdlib.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v retrieving revision 1.132 diff -r1.132 stdlib.php 1009a1010,1013 > function getSubDirs() { > return $this->_subDirList; > } > 1019a1024 > $this->_subDirList = array(); 1037a1043,1046 > if(filetype($dir . $this->_pathsep . $filename) == 'dir') { > array_push($this->_subDirList, "$filename"); > continue; > } Index: WikiUser.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiUser.php,v retrieving revision 1.29 diff -r1.29 WikiUser.php 36c36,38 < 'relativeDates' => new _UserPreference_bool() --- > 'relativeDates' => new _UserPreference_bool(), > 'firstname' => new _UserPreference(''), > 'lastname' => new _UserPreference('') 136a139,141 > // to get the homepage we have to set the userid > $this->_userid = $userid; > 264c269 < if (!$prefs->_prefs and USE_PREFS_IN_PAGE and $this->homePage()) { // in page metadata --- > if (/*!$prefs->_prefs and*/ USE_PREFS_IN_PAGE and $this->homePage()) { // in page metadata 324c329 < function createUser ($pref, $createDefaultHomepage = true) { --- > function createUser ($pref, $createDefaultHomepage = true, $passwd = false) { 326a332,334 > if ($passwd != false) { > $pref->_prefs['passwd'] = $passwd; > } 331c339,342 < $pageinfo = array('pagedata' => array('pref' => serialize($pref->_pref)), --- > if ($passwd != false) { > $pref->_prefs['passwd'] = $passwd; > } > $pageinfo = array('pagedata' => array('pref' => serialize($pref->_prefs)), 347c358 < $template = Template('homepage.tmpl',$this->_request); --- > $template = Template('homepage',$this->_request); 349,350c360,362 < $pageinfo = array('pagedata' => array('pref' => serialize($pref->_pref)), < 'versiondata' => array('author' => $this->_userid), --- > $versiondata = array('author' => $this->_userid); > $pageinfo = array('pagedata' => array('pref' => serialize($pref->_prefs)), > 'versiondata' => $versiondata, 354a367 > /* At the moment disabled: Create-Calender and Create-Preferences 373a387 > */ 392c406 < return true; --- > return false; // FIXME: Empty passwords are not allowed at the moment! 394,396c408,410 < if ($stored_passwd == '*') < return true; < if (!empty($passwd) && crypt($passwd, $stored_passwd) == $stored_passwd) --- > /*if ($stored_passwd == '*') > return true;*/ > if (!empty($passwd) && ($passwd == $stored_passwd) ) 433,435c447,450 < function createUser ($userid, $pref) { < $user = new WikiUser ($userid); < $user->createUser($pref); --- > function createUser ($userid, $pref, $passwd = false) { > $user = new WikiUser ($userid, WIKIAUTH_USER); > $user->createUser($pref, true, $passwd); > return $user; Index: _BackendInfo.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/_BackendInfo.php,v retrieving revision 1.19 diff -r1.19 _BackendInfo.php 21a22 > $this->_request = $request; 78c79 < if ($key == 'passwd' and ! $request->_user->isAdmin()) --- > if ($key == 'passwd' and ! $this->_request->_user->isAdmin()) Index: login.tmpl =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/themes/default/templates/login.tmpl,v retrieving revision 1.20 diff -r1.20 login.tmpl 23a24,27 > <hr noshade="noshade" /> > <b>If you want to register you have to click <a href="<?=WikiURL('UserRegister')?>">here</a></b>. > <hr noshade="noshade" /> > 39,42d42 < <tr> < <td align="right"><?= _("Create Homepage:") ?></td> < <td><input type="checkbox" name="auth[homepage]" <?=$checked?> /></td> < </tr> 70a71,73 > > > <hr noshade="noshade" /> |
From: Matti A. <ma...@ik...> - 2003-01-14 10:16:27
|
Jochen Kalmbach wrote: > If you do the following patches then it [user registration etc.] works. While I haven't yet had time to test the patches, they sound absolutely awesome. I wonder whether they could be added to the CVS? m. |
From: Zot O'C. <zo...@wh...> - 2003-01-24 21:12:32
|
I am testing this code. I see one problem. Can I "authticate" current users who signed in via BOGO? And I get an error when going from AllUsers to a NewUser: Parse error: parse error in /home/httpd/html/wiki/clients/alert2/lib/Template.php(117) : eval()'d code on line 2 putting an error_log in front the code is and a few date stamps, I tracked it down to to printing the browse.tmpl, in the call to _print($CONTENT) <?php // -*-html-*- ?> <!-- $Id: browse.tmpl,v 1.22 2002/02/19 23:00:26 carstenklapp Exp $ --> <?php if (! $revision->isCurrent()) { ?> <p><strong><?php $this->_print(_("Note:"));?></strong> <?php $this->_print(_("You are viewing an old revision of this page."));?> <?php $this->_print( Button('browse', _("View the current version"), $page));?>. </p> <?php } ?> <?php $this->_print($CONTENT);?> <div id="actionbar" class="toolbar"> <hr class="printer" noshade="noshade" /> <p class="editdate"><?php $this->_print( $Theme->getLastModifiedMessage($revision) );?></p> <br><!-- $Id: browse.tmpl,v 1.22 2002/02/19 23:00:26 carstenklapp Exp $ --> <div class="wikitext"><p><br /> <b>Parse error</b>: parse error in <b>/home/httpd/html/wiki/clients/alert2/lib/Template.php(117) : eval()'d code</b> on line <b>2</b><br /></p> </div> So it seems the call to _print($CONTENT) is now failing. On Mon, 2003-01-13 at 12:01, Jochen Kalmbach wrote: > Chip Rosenthal wrote: > > > > I'm using phpwiki-1.3.4. I have ALLOW_USER_LOGIN true, ALLOW_BOGO_LOGIN > > false, and REQUIRE_SIGNIN_BEFORE_EDIT true. > > > > How can the administrative user create user logins? > > This is not possible with the actual version..., > > If you do the following patches then it works. > Then you have the following features: > - User can register him/herself. The user must enter an valid E-Mail account > to receive the password (you can also disable this at the moment by removing > the plugin: UserRegister.php from the attached zip-file) > - Authenticated users can upload files (only. zip, pdf, jpg, gif, png, txt) > and link to them in any wiki-page > - Administrators can create user accounts (an automatic email is sent to the > user if you want) > > All this you can test on: http://wiki.kalmbachnet.de/ > > Greetings > Jochen > > PS: > The follwoing files are new: > - lib/plugin/UserAdminCreateUser.php > - lib/plugin/UserRegister.php > - lib/plugin/UserFileManagement.php > - pgsrc/AdminCreateUser > - pgsrc/UserRegister > > The following patches are needed (all included in the attached file): > > Index: config.php > =================================================================== > RCS file: /cvsroot/phpwiki/phpwiki/lib/config.php,v > retrieving revision 1.68 > diff -r1.68 config.php > 260c260,266 > < if (!defined('DATA_PATH')) define('DATA_PATH', dirname(SCRIPT_NAME)); > --- > > if (!defined('DATA_PATH')) { > > $temp = dirname(SCRIPT_NAME); > > if ( ($temp == '/') || ($temp == '\\') ) > > $temp = ""; > > define('DATA_PATH', $temp); > > } > > > > Index: display.php > =================================================================== > RCS file: /cvsroot/phpwiki/phpwiki/lib/display.php,v > retrieving revision 1.38 > diff -r1.38 display.php > 66a67,70 > > > > header("Cache-Control: no-cache, must-revalidate"); > > header("Expires: 0"); > > > 135a140,143 > > > > header("Cache-Control: no-cache, must-revalidate"); > > header("Expires: 0"); > > > > Index: Request.php > =================================================================== > RCS file: /cvsroot/phpwiki/phpwiki/lib/Request.php,v > retrieving revision 1.24 > diff -r1.24 Request.php > 331a332,335 > > > > function move($dest) { > > return move_uploaded_file($this->_info['tmp_name'], $dest); > > } > > Index: stdlib.php > =================================================================== > RCS file: /cvsroot/phpwiki/phpwiki/lib/stdlib.php,v > retrieving revision 1.132 > diff -r1.132 stdlib.php > 1009a1010,1013 > > function getSubDirs() { > > return $this->_subDirList; > > } > > > 1019a1024 > > $this->_subDirList = array(); > 1037a1043,1046 > > if(filetype($dir . $this->_pathsep . $filename) == 'dir') { > > array_push($this->_subDirList, "$filename"); > > continue; > > } > > Index: WikiUser.php > =================================================================== > RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiUser.php,v > retrieving revision 1.29 > diff -r1.29 WikiUser.php > 36c36,38 > < 'relativeDates' => new _UserPreference_bool() > --- > > 'relativeDates' => new _UserPreference_bool(), > > 'firstname' => new _UserPreference(''), > > 'lastname' => new _UserPreference('') > 136a139,141 > > // to get the homepage we have to set the userid > > $this->_userid = $userid; > > > 264c269 > < if (!$prefs->_prefs and USE_PREFS_IN_PAGE and $this->homePage()) > { // in page metadata > --- > > if (/*!$prefs->_prefs and*/ USE_PREFS_IN_PAGE and > $this->homePage()) { // in page metadata > 324c329 > < function createUser ($pref, $createDefaultHomepage = true) { > --- > > function createUser ($pref, $createDefaultHomepage = true, $passwd = > false) { > 326a332,334 > > if ($passwd != false) { > > $pref->_prefs['passwd'] = $passwd; > > } > 331c339,342 > < $pageinfo = array('pagedata' => array('pref' => > serialize($pref->_pref)), > --- > > if ($passwd != false) { > > $pref->_prefs['passwd'] = $passwd; > > } > > $pageinfo = array('pagedata' => array('pref' => > serialize($pref->_prefs)), > 347c358 > < $template = Template('homepage.tmpl',$this->_request); > --- > > $template = Template('homepage',$this->_request); > 349,350c360,362 > < $pageinfo = array('pagedata' => array('pref' => > serialize($pref->_pref)), > < 'versiondata' => array('author' => > $this->_userid), > --- > > $versiondata = array('author' => $this->_userid); > > $pageinfo = array('pagedata' => array('pref' => > serialize($pref->_prefs)), > > 'versiondata' => $versiondata, > 354a367 > > /* At the moment disabled: Create-Calender and Create-Preferences > 373a387 > > */ > 392c406 > < return true; > --- > > return false; // FIXME: Empty passwords are not allowed at > the moment! > 394,396c408,410 > < if ($stored_passwd == '*') > < return true; > < if (!empty($passwd) && crypt($passwd, $stored_passwd) == > $stored_passwd) > --- > > /*if ($stored_passwd == '*') > > return true;*/ > > if (!empty($passwd) && ($passwd == $stored_passwd) ) > 433,435c447,450 > < function createUser ($userid, $pref) { > < $user = new WikiUser ($userid); > < $user->createUser($pref); > --- > > function createUser ($userid, $pref, $passwd = false) { > > $user = new WikiUser ($userid, WIKIAUTH_USER); > > $user->createUser($pref, true, $passwd); > > return $user; > > Index: _BackendInfo.php > =================================================================== > RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/_BackendInfo.php,v > retrieving revision 1.19 > diff -r1.19 _BackendInfo.php > 21a22 > > $this->_request = $request; > 78c79 > < if ($key == 'passwd' and ! $request->_user->isAdmin()) > --- > > if ($key == 'passwd' and ! > $this->_request->_user->isAdmin()) > > Index: login.tmpl > =================================================================== > RCS file: /cvsroot/phpwiki/phpwiki/themes/default/templates/login.tmpl,v > retrieving revision 1.20 > diff -r1.20 login.tmpl > 23a24,27 > > <hr noshade="noshade" /> > > <b>If you want to register you have to click <a > href="<?=WikiURL('UserRegister')?>">here</a></b>. > > <hr noshade="noshade" /> > > > 39,42d42 > < <tr> > < <td align="right"><?= _("Create Homepage:") ?></td> > < <td><input type="checkbox" name="auth[homepage]" <?=$checked?> /></td> > < </tr> > 70a71,73 > > > > > > <hr noshade="noshade" /> -- Zot O'Connor http://www.ZotConsulting.com http://www.WhiteKnightHackers.com |
From: Jochen K. <Jo...@Ka...> - 2003-01-26 13:25:13
|
> I am testing this code. I see one problem. Can I "authticate" current > users who signed in via BOGO? You should be able to use the BOGO login, but then you have no authentication... > And I get an error when ... NewUser: > Parse error: parse error in > /home/httpd/html/wiki/clients/alert2/lib/Template.php(117) : eval()'d > code on line 2 This is a well known bug. The problem is that the current "homepage.tmpl" is not valid. Simple create your own and it will work... Greetings Jochen |
From: Zot O'C. <zo...@wh...> - 2003-01-27 18:42:34
|
On Sun, 2003-01-26 at 05:30, Jochen Kalmbach wrote: > > I am testing this code. I see one problem. Can I "authticate" current > > users who signed in via BOGO? > > You should be able to use the BOGO login, but then you have no > authentication... That what I was asking. I was trying to add this to a current site. There are already users there (few). I was trying to autehticate existing users. Even if I run separate code, that would be fine (prefer not to run direct SQL, but I can handle that too). > > > And I get an error when ... NewUser: > > Parse error: parse error in > > /home/httpd/html/wiki/clients/alert2/lib/Template.php(117) : eval()'d > > code on line 2 > > This is a well known bug. The problem is that the current "homepage.tmpl" is > not valid. > Simple create your own and it will work... > Can you email a working default home. I am not sure what is broken in the page (and its only 13 lines long!). Thanks. > Greetings > Jochen -- Zot O'Connor http://www.ZotConsulting.com http://www.WhiteKnightHackers.com |
From: Jochen K. <Jo...@Ka...> - 2003-01-27 18:56:13
|
"Zot O'Connor" wrote: > On Sun, 2003-01-26 at 05:30, Jochen Kalmbach wrote: > > > I am testing this code. I see one problem. Can I "authticate" current > > > users who signed in via BOGO? > > > > You should be able to use the BOGO login, but then you have no > > authentication... > > That what I was asking. I was trying to add this to a current site. > There are already users there (few). I was trying to autehticate > existing users. To autehnticate users you need an username and a password. You can simply add a user by calling the UserRegistartion-page from an admin account... But maybe I am standiing on the line (bad tranlation from german) > > Simple create your own and it will work... > > Can you email a working default home. I am not sure what is broken in > the page (and its only 13 lines long!). <homepage.tmpl> <?php // -*-html-*- $Id$ $username = $user->getId(); ?> This page is generated automatically. This is the homepage of the user.%%% You can change it if you want. </homepage.tmpl> Greetings Jochen |
From: Zot O'C. <zo...@wh...> - 2003-01-29 10:15:28
|
On Mon, 2003-01-27 at 11:01, Jochen Kalmbach wrote: > "Zot O'Connor" wrote: > > On Sun, 2003-01-26 at 05:30, Jochen Kalmbach wrote: > > > > I am testing this code. I see one problem. Can I "authticate" > current > > > > users who signed in via BOGO? > > > > > > You should be able to use the BOGO login, but then you have no > > > authentication... > > > > That what I was asking. I was trying to add this to a current site. > > There are already users there (few). I was trying to autehticate > > existing users. > > To autehnticate users you need an username and a password. > You can simply add a user by calling the UserRegistartion-page from an admin > account... I guess I am not clear here. I have users, typically with no password. Does that make them not-authenticated? I am trying to take advatnage of the user*management* not just the creation part. > > But maybe I am standiing on the line (bad tranlation from german) > > > > > Simple create your own and it will work... > > > > Can you email a working default home. I am not sure what is broken in > > the page (and its only 13 lines long!). > > <homepage.tmpl> > <?php // -*-html-*- $Id$ > $username = $user->getId(); > ?> > This page is generated automatically. This is the homepage of the user.%%% > You can change it if you want. > </homepage.tmpl> > > Greetings > Jochen Thanks -- Zot O'Connor http://www.ZotConsulting.com http://www.WhiteKnightHackers.com |