User register script

55 views
Skip to first unread message

coolcold

unread,
Dec 14, 2006, 3:30:50 PM12/14/06
to ccTiddly
Finally got time to release the user register script. As blogthis.php,
it is released as patch/feature request. Be warned that passwords are
not encrypted.
https://sourceforge.net/tracker/index.php?func=detail&aid=1615995&group_id=156016&atid=798095

CC

pier9

unread,
Dec 16, 2006, 8:48:29 PM12/16/06
to ccTiddly
Hi CC,

Thank you very much. I really need this (and some others most probably
too) and I am really sorry to have taken so long to read my mail and
react.

But I have a few questions after I tried to set this script up.
a) I have inserted a blank user.php file inside the config directory
b)The permission of config folder is rwx (700)
c) I have done steps 3 and 4 of the instructions

Then what is supposed to happen. Is the self registration to occur from
the new user inputing his (her) name and pwd inside some fields to
place inside a tiddler?

Cheers and thanks again for the feature+
Pier

pier9

unread,
Dec 17, 2006, 2:09:41 AM12/17/06
to ccTiddly
Hi again

After some sleep (and during some) I just answered myself the question
(: go to http://siteUrl/register.php). Sorry for the post before.

It works great !

I'm just wondering, if there are different privilege groups, in which
ones the self registered users end up. Is there a way to assign these
persons to a group?
Best
Pier

coolcold

unread,
Dec 17, 2006, 8:12:30 AM12/17/06
to ccTiddly
All new users will be in the "user" group. If you are confident in
editting the file, do the following

1/ open register.php
2/ go to line 70 and add a new line after it
3/ put in the following code after it
$content .= '$tiddlyCfg[\'group\'][\'<group name>\'][] =
'.$username.";\n";
replace <group name> with the group name of your choice

CC

pier9

unread,
Dec 17, 2006, 3:00:20 PM12/17/06
to ccTiddly
I'm in trouble :
The site now shows 500 Internal Server error after I deleted the
user.php file which contained the username and password of a self
registered user I created.

I did this because I tried your explanation but I probably misplaced
step 3 (not able to count up to 70 I guess :-(
it showed this error so I deleted everything but I was probably logged
as this user.

I can't recover my sites (3 online versions).
Please Help !
Pier

coolcold

unread,
Dec 18, 2006, 3:02:45 AM12/18/06
to ccTiddly
Hi,

Try change this line
$content .= '$tiddlyCfg[\'user\'][\''.$username.'\'] =
'.$password.";\n";
to these two
$content .= '$tiddlyCfg[\'user\'][\''.$username.'\'] =
'.$password.";\n";


$content .= '$tiddlyCfg[\'group\'][\'<group name>\'][]
='.$username.";\n";

You can try to use some text editor that shows line number such as
notepad++

After you delete the user.php, have you remove the include_once from
your config files?

CC

pier9

unread,
Dec 18, 2006, 6:39:29 AM12/18/06
to ccTiddly
Hi,
Sites are back to normal it seems Thank you very much. I will install
another site with all I've learned and experimented so far. I will be
back to the registration after that.
Cheers
Pier

coolcold

unread,
Dec 18, 2006, 8:58:35 AM12/18/06
to ccTiddly
Hi,

What were the problem before?

CC

pier9

unread,
Dec 19, 2006, 2:15:36 AM12/19/06
to ccTiddly
Hi,
THis 500 internal server error was maybe due to a misplacement of the
line $content .= '$tiddlyCfg[\'group\'][\'<group name>\'][] =
'.$username.";\n";
then I tried to delete all that pertained to register but I had left
the default.php with the add on line and that was it.
I think that the new user I had tried was logged on when I cleaned the
files but did not dissapear entirely. So I deleted one occurence in the
DB (the tiddler this "new user" created). But that did not revert the
site to normal.
Hope this explaination helps?
Pier

pier9

unread,
Dec 19, 2006, 2:49:51 AM12/19/06
to ccTiddly
CC,
please check this unexpected behaviour on http://p.edelman.free.fr/WIK5

this is the user.php file content :
<?php
$tiddlyCfg['user']['kool'] =dude;
$tiddlyCfg['group']['<group name>'][]=kool;
?>
<?php
$tiddlyCfg['user']['abc'] =def;
$tiddlyCfg['group']['user1'][]=abc;
?>

Where kool has a normal view of the site allthough I forgot to indicate
that he should have a user1 status.
Then I changed the register.php file to reflect that on any new
entrant, but abc has a wrong view of the site.

alpha (pwd omega) created straight into the default .php the "old way"
has a user1 privilege and can see the site normally (like kool).
Where's the catch?
Pier

coolcold

unread,
Dec 19, 2006, 3:17:27 AM12/19/06
to ccTiddly
Hi,

your user.php file content is superb. Fixed the bug. A mistake on my
side. You can download them off sf again.

Cheers,

CC

pier9

unread,
Dec 19, 2006, 4:14:37 PM12/19/06
to ccTiddly
Hi CC

I get this :
Fatal error: Call to undefined function: formatparameters() in
/mnt/132/sdc/0/6/p.edelman/WIK5/register.php on line 50

after I set the groupname as user1 and removed the // in front of this
line (new register file).

Kool and abc have the same view of the site as before, one Ok the other
notOk

I tried to remove the old user.php with their ID pwd and started with a
blank file again, but to no avail.
Any clue to what I did wrong ?
Pier

coolcold

unread,
Dec 19, 2006, 6:44:34 PM12/19/06
to ccTiddly
Sorry, am too tired lately with my work and keep on making mistakes.
Please uncomment the formatParmeters function (removing /* and */).
Otherwise I have updated the one on sf's site. I have also added a new
variable, $user_group, to ease changing default user group in the new
one.

Could you use a new "user.php" and let me know if it works?

Thanks.

CC

pier9

unread,
Dec 20, 2006, 1:09:22 AM12/20/06
to ccTiddly
Hi CC,

New user darth , pwd : vador created OK, but its rights seem admin
like.

When trying to log it out I get this on top of the header now
Warning: Cannot modify header information - headers already sent by
(output started at /mnt/132/sdc/0/6/p.edelman/WIK5/config/user.php:1)
in /mnt/132/sdc/0/6/p.edelman/WIK5/index.php on line 29

Warning: Cannot modify header information - headers already sent by
(output started at /mnt/132/sdc/0/6/p.edelman/WIK5/config/user.php:1)
in /mnt/132/sdc/0/6/p.edelman/WIK5/index.php on line 30

Warning: Cannot modify header information - headers already sent by
(output started at /mnt/132/sdc/0/6/p.edelman/WIK5/config/user.php:1)
in /mnt/132/sdc/0/6/p.edelman/WIK5/index.php on line 31

the user.php file is empty

and it is not logged out.

the URL shows :
http://p.edelman.free.fr/WIK5/index.php?logout=1&logout=1&

Also, get some rest.
Take care
Pier

coolcold

unread,
Dec 20, 2006, 3:45:41 AM12/20/06
to ccTiddly
Hi,

I got a slightly different error code when I logout after using
darth:vador. It says


Warning: Cannot modify header information - headers already sent by
(output started at

/mnt/132/sdc/0/6/p.edelman/WIK5/config/default.php:1) in
/mnt/132/sdc/0/6/p.edelman/WIK5/index.php on line 29

Warning: Cannot modify header information - headers already sent by
(output started at

/mnt/132/sdc/0/6/p.edelman/WIK5/config/default.php:1) in
/mnt/132/sdc/0/6/p.edelman/WIK5/index.php on line 30

Warning: Cannot modify header information - headers already sent by
(output started at

/mnt/132/sdc/0/6/p.edelman/WIK5/config/default.php:1) in
/mnt/132/sdc/0/6/p.edelman/WIK5/index.php on line 31

Can you remove any of the newline not within <?php and ?> in
default.php and user.php? They would tend to cause this problem when
there are too many linebreaks in between php scripts which got output
to the browser.

CC

coolcold

unread,
Dec 20, 2006, 4:03:20 AM12/20/06
to ccTiddly
>Also, get some rest.
Take care

Thanks. Need to struggle until the end of Jan for my deadline
unfortunately :(

CC

pier9

unread,
Dec 21, 2006, 2:33:21 AM12/21/06
to ccTiddly
Hi CC,

No change.
Then after chceking the user file, it showed no user group for darth
So I forced it at user1 but it makes no difference.
Pier

google....@dfgh.net

unread,
Dec 21, 2006, 3:46:57 AM12/21/06
to ccTi...@googlegroups.com
Hi,

Have you remove the newlines after ?> in default.php and user.php?

CC

pier9

unread,
Dec 21, 2006, 7:58:05 AM12/21/06
to ccTiddly
No, It does not change anything. there was one extra blank line in
user.php and one in register; default was ok.

As more precision about the behaviour : it seems that the logout button
triggers the garbage on top of the header. When removing the
index.php?logout=1&logout=1&logout=1&... from the URL, it looks normal
again. But the user (any user) is still logged in.

Also, it is possible to enter another user and pwd and hit 'logout' to
be logged as this new user (also as anonymous and " "; then the button
reverts to login ).

Hope this helps.
Pier

coolcold

unread,
Dec 21, 2006, 4:20:24 PM12/21/06
to ccTiddly
Hi,

Can you try to change the language back to english to see if it works?
Seems like there is a problem when I use a language with UTF8 formatted
php file.

CC

pier9

unread,
Dec 21, 2006, 5:13:27 PM12/21/06
to ccTiddly
Well, This site is in English from the beginning
Pier

coolcold

unread,
Dec 21, 2006, 5:38:25 PM12/21/06
to ccTiddly
I am running out of ideas. Do you think if it is possible for you to
email me your ccT files for me to test? Just remember to strip out the
passwords.

CC

AcD

unread,
Dec 25, 2006, 7:49:46 AM12/25/06
to ccTiddly
Free.fr homepages tend to do weird stuff with text encodings,
especially when it comes to UTF8.
May be worth double-checking how your .php files are encoded, text and
line-breaks wise.

coolcold

unread,
Dec 26, 2006, 2:14:34 AM12/26/06
to ccTiddly
Yes, the problem is with encoding when it comes with header. The
default.php and user.php is set to UTF-8 and thus creating errors when
sending headers. Not sure why it does that though :(

CC

pier9

unread,
Jan 12, 2007, 12:31:20 AM1/12/07
to ccTiddly
> Yes, the problem is with encoding when it comes with header. The
> default.php and user.php is set to UTF-8 and thus creating errors when
> sending headers.

Hi CC,

I'm not sure since everything worked all right and all at once, all my
ccT 1.1 final sites (count 6) have this strange behaviour.
The 7th one with rel 1.0 is OK

In fact, it is only when I logout that this occurs.
To logout, I need an empty username field (or I keep being logged in ),
then I hit logout.
The garbage appears on top of the page and the url has :
/index.php?logout=1&logout=1&
If I erase this and reload it gets back to normal as anonymous or
whomever username had logged in instead.
If you care to check at http://p.e.free.fr/wik6/ with alpha omega as
loggin password, I'd appreciate.

(excuse me on the long delay between posts since I was working on the
translation; post coming soon).
Cheers
Pier

google....@dfgh.net

unread,
Jan 12, 2007, 3:50:06 AM1/12/07
to ccTi...@googlegroups.com
Hi,

try to open your default.php and change the character encoding to ANSI and see if it works

CC

MilchFlasche

unread,
Jan 13, 2007, 4:41:28 AM1/13/07
to ccTiddly
Thank you CC for this great script!

I've tried it on 1.0, and it seems incompatible :p But on 1.1 it works
like a charm. Anyway, I will upgrade to 1.1 later :)

On 2006年12月15日, 上午4時30分, "coolcold"
<google.coolc...@dfgh.net> wrote:
> Finally got time to release the user register script. As blogthis.php,
> it is released as patch/feature request. Be warned that passwords are
> not encrypted.https://sourceforge.net/tracker/index.php?func=detail&aid=1615995&gro...
>
> CC

pier9

unread,
Jan 16, 2007, 4:23:57 PM1/16/07
to ccTiddly
Hi CC,
Sorry to get back to this as it is not solved ... But I have a new cue
for those in the know :

I believe that the ugly warning on top of the header comes from this
line #31 in index.php and the 2 lines before :
header("Location:
".$_SERVER['PHP_SELF'].'?'.str_replace("logout=1&","",$_SERVER['QUERY_STRING'])); //redirect
to itself to refresh

It may not have anything to do with unicode and all.

Please help
Cheers
Pier

pier9

unread,
Jan 17, 2007, 9:00:28 AM1/17/07
to ccTiddly
Yesss
It is an encoding issue:
I just made all the files ANSI encoded (and utf8 without BOM) and it
works.
Sorry for the bandwith usage.
Cheers

pier9

unread,
Jan 18, 2007, 2:10:40 AM1/18/07
to ccTiddly
Hi,
As I said in another thread, all it takes is to make sure that the
files one changes are ANSI encoded.
Pb solved
Pier

pier9

unread,
Jan 24, 2007, 9:33:42 AM1/24/07
to ccTiddly
I thought I answered this a while ao but no. The end word is that ANSI
encoding is what we need.
Cheers
Pier

Reply all
Reply to author
Forward
0 new messages