One of the features I would have liked while testing Gallery was/is the ability to allow users to register their own name/password, so they could create their own albums without the Admin (me creating their account for them. Since my sites are fairly active (in the first 3 days of announcing Gallery, nearly 100 users have created albums containing about 900 photos) so to manually add each user as the ADMIN might have been – ummmm – “interesting
Posts: 3
Hi,
Your register hack works fine, except, after entering the info for a new account, no confirmation message appears. The new user is actually created, though.
I've re-read your instructions and can't find where I skipped anything. But, right now I'm bleary eyed from staring at the computer screen all day.:roll:
I appreciate any suggestions you can give me to get this last little bit working.
Thanks so much,
Karen
Posts: 4
Hi Karen..!
Sorry about that...! I just re-read the instructions in the ZIP file, and made the following change (I updated the README in the ZIP with the following info):
----
FIND the following line in "register.php" (occurs twice):
header("Location: manage_users.php");
And REPLACE with:
header("Location: regok.htm");
-----
That should bring up the the simple confirmation page for your users once they are registered....
Great catch!!!!
Posts: 3
Hi John_d,
Thanks for the quick reply!
I made the change and it works great.
I'm so glad to have found Gallery and your user registration function will really work out great for my photographers' site.
The fact that Gallery automates the creation of thumbnails is really a help for my clients who are not so great at working with Photoshop. It's been a real challenge to try to teach them long-distance how to make good quality thumbnails for their sites. Now, I can set them up with a Gallery account and they can even upload their photos in batches via the Gallery Remote, and all the thumbnailing work is done by the Gallery program. I'm so happy! :lol:
Thanks again,
Karen
Posts: 4
Hi Karen,
My pleasure - glad you got it working.!!! Also - is your Gallery on a Public Access server? - I'd really like to see what others have done for customizing Gallery to match their overall web design (I've been through the Samples areas a few times)..
If you'd like - here is a link to the one I've been working on (and after seeing Bharat's personal album in the Samples area (more specificially, his car) :smile: ) - I probably shouldn't share it, but: http://gallery.rennlist.com (will take you to that SLD server, not the main site). It's been on-line for a whopping 4 days (2 days as Beta and 2 days in production), but for that, some folks have posted some terrific albums...
Best to you,
John
Posts: 54
Hi,
Just 1 little thing, while I was checking your gallery I found that if you click register and then simply click the cancel button,( without entering anything ) you still have the registration confirmation page coming up.
Really nice cars anyway. :smile:
phil
Posts: 487
John, do you have the time to make a proper patch for this, including configuration
support to enable/disable the register option? This sounds like something useful
for a future gallery release that we should send off to bharat for possible
inclusion.
Posts: 4
Hi Phil and vallimar..!
Phil - great catch on the Cancel button! Let me spend a little time this weekend on that. At the same time, I had also thought about vallimar's suggestion when I was doing this, and I think there would be a way to set the variable on or off in the configuration page and allow folks to set it up from their installation. Vallimar, is that what you mean when you mention a "patch" for this feature??
Anyway - thanks for he feedback, and let me apend some time with these suggestions - they are great! Thanks!!!
John
Posts: 54
Hi john_d,
This is a great idea to give public the option to register, and this is really something missing in gallery. However, I think that the register system should be more "secure" if we want to use gallery in a public confuguration.
I mean, the fact that anybody could register without giving a valid email could bring your gallery to get some unwanted pictures, like porn or stuff like.
Asking for a real email and sending a auto generated password should lower greatly that risk.
Just a thought... great hack anyway, congratulations..
phil
Posts: 2
Love hack... Just a couple of problems:
Your new readme.txt file has an error, it was driving me nuts for a while trying to figure it out.
This is what is in the README.txt
AND DIRECTLY ABOVE that line - INSERT:
$adminCommands .= '<a href="#" onClick="'.popup("user.php").'">[register]</a>
The command needs '; at the end to phrase correctly:
AND DIRECTLY ABOVE that line - INSERT:
$adminCommands .= '<a href="#" onClick="'.popup("user.php").'">[register]</a>';
Thought I found something else but it is not with your hack.. :wink:
Posts: 2
Fix for the 'cancel' button:
Open user.php with your editor and got the the bottom and look for
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> <input type=submit name="submit" value="Cancel"> </TD></TR></TABLE><!-- BBCode End -->
and change it to
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> <input type=submit name="submit" value="Cancel" onclick='parent.close()'> </TD></TR></TABLE><!-- BBCode End -->
that should do the trick... :wink:
Posts: 115
I just installed your hack and after a little debugging, it's working. I just wanted to let you know what changes I had to make in order to get it working.
These are changes that you should make to the readme.txt. Please keep in mind I have the following setup:
-Windows 2k with SP2
-Apache 1.3.26
-PHP 4.2.4-dev
-Gallery 1.3.2 CVS b8
1) Without this change, you get a parsing error when register.php is called:
Current:
FIND the following lines in "register.php" (occurs once):
if (!$gallery->user->isAdmin()) {
exit;
DELETE the following lines from "register.php":
if (!$gallery->user->isAdmin()) {
exit;
Should be:
FIND the following lines in "register.php" (occurs once):
if (!$gallery->user->isAdmin()) {
exit;
}
DELETE the following lines from "register.php":
if (!$gallery->user->isAdmin()) {
exit;
}
2) This may only be on WIN32 systems:
Current:
NEXT (THIS IS IMPORTANT!!), FIND the following line in "register.php" (occurs once):
<?= makeFormIntro("create_user.php",
And REPLACE with:
<?= makeFormIntro("register.php",
Should be:
NEXT (THIS IS IMPORTANT!!), FIND the following line in "register.php" (occurs once):
<?php echo makeFormIntro("create_user.php",
And REPLACE with:
<?php echo makeFormIntro("register.php",
3) This is just a suggestion, to keep things cleaner:
Current:
If your site has a stated TOS, FIND:
<a target="_blank" href="http://your.domain.com/TOS.htm">
and REPLACE it with the actual URL of your site TOS. If you don't have a TOS (and you should!), then remove the HREF links.
Change to:
If your site has a stated TOS, FIND:
<a target="_blank" href="http://your.domain.com/TOS.htm">
and REPLACE it with the actual URL of your site TOS.
If you don't have a TOS (and you should!), then remove this chunk of code:
<tr>
<td>
You Agree to Acceptable Use<br>
as stated in the <a target="_blank" href="http://your.domain.com/TOS.htm">
TOS</a>
</td>
<td align="center">
<select name="canCreate" size=1 >
<option value=1 selected> yes
<option value=0 > no
</select>
</td>
</tr>
Thank you very much for this hack, I love having it!!!!!
If I might be so bold as to ask for a few additional features:
1) As talked about, the ability to turn this option on an off within the config.
2) The ability to allow users to register, but not create new albums. (In some cases, I want users to have to register and agree to a TOS before getting in, but I don't want them to be able to create albums or upload images.)
3) Having the system email the administrator (or a chosen user) each time a new user registers.
4) The ability to choose the minimum length of username and/or password.
5) Ability to only allow properly formatted email address'.
6) The ability to have a random password send to user after registration, rather than them choosing it. Thus making it a bit more secure b/c you know you can contact the user.
Again, thank you VERY much!!
Marc
Posts: 115
I hate to be a pain in the butt, but I found that if a user enters an invalid username or password, they are properly sent to a new screen telling them of the minimum requirements, but if you press cancel on that page, you get the regok.htm page showing up. (No user was created though, atleast as far as I could tell.)
Again, thank you for your great work!!!
Marc
Posts: 7
Hi
This is a great addon - thanks
but I still have a problem. Hopefully you can help
People can register adn login but they CAN"T add an album until I, as admin, go into their user name and modify them to create an album. As admin, I can create albums, and once I add taht to a specific user, they can too. BUT
Is there somewhere I can change that so that someone can register adn immediately add photos without my doing something?
Thanks
running on PHP 4.1 and Apache at host
Posts: 172
Take a look:
http://66.246.7.104/
I developed my own real time self regsister gallery system for my transit fans
its not finished but almost finished until I fix the random block then its all done :smile:
If you need help, lemme know and I can fix your problem
Cheers!
Posts: 2
thx
evey thing work great for me
<!-- BBCode Start --><A HREF="http://www.funvill.com" TARGET="_blank">funvill.com</A><!-- BBCode End -->
Posts: 26
THANK YOU SO MUCH!! I love this hack. it's fantastic. it's exactly what I needed. I"m still fine tuning my gallery but you can see what I've done with it so far including your hack.
http://www.vampirecommunity.com
Posts: 89
Great Hack John, thanks for sharing it with us! I'm sure your P-car users appreciate it also.
Posts: 4
I was wondering if you can add to this module so wehn people create a user then an album will be created and assigned to that user. (something like a dating module, each user has his own album), and a way for the user to upload pictures on the same page where they create the account. (with possibility to login later and change/add more).
I know this sounds a bit much but maybe someone is bored and has time to do mods :smile:
And i guess gallery is a very good script to make a dating module/script out of.
Posts: 2
I love this hack, it's a fix that lets me build what I want to.
One problem, I get a cannot find server error message when I submit my info and "create"
I looked at the pages and I I set everything up in create correctly, I even tested the fixes posted in this thread.
Has anyone else had these problems?
john
Posts: 2
I tried accessing the page directly through register.php and the script worked.
It does not work in the popup. Help...anyone?
Posts: 160
i used your "hack" and have a small problem, i get some php errors i can't fix without help :}
<!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&name=phpBB_14&file=index&action=viewtopic&topic=2147&1" TARGET="_blank">error description</A><!-- BBCode End -->
thanks..
Posts: 42
Whats the address to your site?
Posts: 17
As php is very new to me i cant say how hard it would be but it seems that the CMS portals like nuke/postnuke that already have built in user lists would blend well into this concept of users registering ? not unlike the phpBB_14 use of the same concept
Posts: 6
cool,
thx thx thx for your great hack . . .
one more question :
do you know how to connect the image gallery login with the postnuke login ?
so that users can register over the postnuke page ... ?
postnuke and the gallery working handin hand ..
thx .
Posts: 81
Just posting to see if anyone has figured out a way to restrict the registration a bit - ie, random password, not allowing to create albums until approved, etc.......might get into this myself if no one else has already.
Oh, and I installed this, and it works great! Thanks again John.
Posts: 3
I did everything as it says in the readme file, and get this error:
Parse error: parse error in /www/m/markj02/htdocs/gallery/register.php on line 32
here is the code from around line 32:
?>
<?php
// Hack prevention.
if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
!empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
print "Security violationn";
exit;
}
?>
<?php require($GALLERY_BASEDIR . "init.php"); ?>
<?php
}
if ($submit) {
if (!strcmp($submit, "Create")) {
$gErrors["uname"] = $gallery->userDB->validNewUserName($uname);
if ($gErrors["uname"]) {
$errorCount++;
}
if (strcmp($new_password1, $new_password2)) {
$gErrors["new_password2"] = "Passwords do not match!";
$errorCount++;
} else {
$gErrors["new_password1"] =
$gallery->userDB->validPassword($new_password1);
if ($gErrors["new_password1"]) {
$errorCount++;
}
}
if (!$errorCount) {
$tmpUser = new Gallery_User();
$tmpUser->setUsername($uname);
$tmpUser->setPassword($new_password1);
$tmpUser->setFullname($fullname);
$tmpUser->setCanCreateAlbums($canCreate);
$tmpUser->setEmail($email);
$tmpUser->save();
header("Location: regok.htm");
}
(line 32 is the last line here
<?php require($GALLERY_BASEDIR . "init.php"); ?>
<?php
}
Any ideas?
the site address is:
<!-- BBCode Start --><A HREF="http://www.chopperunderground/gallery" TARGET="_blank">Chopper Underground Gallery</A><!-- BBCode End -->
Thanks so much for the help.
Mark
Posts: 4
So where is the user_login.zip from (now 404) http://gallery.rennlist.com/user_login.zip today?
Posts: 487
I created a better patch for this, check the cvs mailing list archives for the code.
Posts: 7
anybody where can i get this
Posts: 3474
This was answered for you here:
http://gallery.sf.net/forums.php?topic=3657
Please don't flood every post with the same question! Otherwise we waste time answering the same question over and over.
Posts: 88
What is the latest version of the patch and which directory do I upload it to? Also what do I save the file as? (eg. extention)I tried the one from the above link and keep getting errors.
Thank you,
Marie Alline
Posts: 3473
Marie,
You have a nuke/postnuke environment, right? That uses it's own user list. The patch would not work with N/PN
Posts: 7
Quote:
Hi
This is a great addon - thanks
but I still have a problem. Hopefully you can help
People can register adn login but they CAN"T add an album until I, as admin, go into their user name and modify them to create an album. As admin, I can create albums, and once I add taht to a specific user, they can too. BUT
Is there somewhere I can change that so that someone can register adn immediately add photos without my doing something?
Thanks
running on PHP 4.1 and Apache at host
is there answer for this i to havethe same problem
Posts: 30
where is the code for the defult to "User can create albums" I am trying to set it to no!