It looks like 1.1.5 broke the most recent xp_publish.php.. it used:
$albumlist = array();
genAlbumList($albumlist);
which looks like it's been deprecated by:
$albumlist = getManagedAlbumList();
Unfortunately, that function doesn't just work, because you don't have a $_zp_current_admin['id'] from the way xp_publish.php currently handles authentication (old-school style):
function process_login() {
if (isset($_POST['user']) && isset($_POST['pass'])) {
$user = $_POST['user'];
$pass = $_POST['pass'];
$check_auth = md5($user . $pass);
if ($user == getOption('adminuser') && $check_auth == getOption("adminpass")) {
setcookie("zenphoto_wizard", md5($user . $check_auth), time()+5184000, $cookiepath);
$_zp_loggedin = true;
} else {
setcookie("zenphoto_wizard", "", time()-368000, $cookiepath);
}
}
if ($_zp_loggedin) {
$this->form_album();
} else {
$this->form_login('The username or password you entered are not correct');
}
}
Now it looks like it has to do something more along the lines of?
foreach (getAdministrators() as $user) {
if ($user['user'] == $user && $user['pass'] == $pass) {
$_zp_current_admin = $user;
setcookie("zenphoto_wizard", md5($user . $check_auth), time()+5184000, $cookiepath);
$_zp_loggedin = true;
$this->form_album();
break;
}
}
if (!$_zp_loggedin) {
setcookie("zenphoto_wizard", "", time()-368000, $cookiepath);
$this->form_login('The username or password you entered are not correct');
}
But that's not working for me either, I think because getAdministrators() isn't returning anything? At this point it's getting a little too involved for me!
Do you think somebody could check it out and make the necessary fixes to the xp_publish.php authentication?
Also, what to people think about just including xp_publish.php as part of the standard distribution, and then there could be a link to it on the upload tab even as an alternate method?
P.S. there's also another bug at the end of xp_publish.php as far as I can tell; believe it or not:
\CurrentVersion\Explorer\PublishingWizard\Providers
should actually be:
\CurrentVersion\Explorer\PublishingWizard\PublishingWizard\Providers
!
Comments
Zurg!
The function you mention--`getManagesAlbumList()` is quite different and probably does not do what xp_publish needs. I suggest you replicate the old function, listed below, in xp_publish.
`function genAlbumList(&$list, $curAlbum=NULL) {
global $gallery;
if (is_null($curAlbum)) {
$albums = $gallery->getAlbums(0);
} else {
$albums = $curAlbum->getSubAlbums(0);
}
foreach ($albums as $folder) {
$album = new Album($gallery, $folder);
$list[$album->getFolder()] = $album->getTitle();
genAlbumList($list, $album); /* generate for subalbums */
}
}`
From XP, after you run the reg, then, select a picture in explorer and on the left hand side of explorer there is a "Publish to web" link, Choose the gallery and from there you follow the wizard.
If you wanted to test the scripts, you have to use a browser, but there are no buttons (because the publishing wizard takes care of the buttons(thats where all the javascript comes in)).. first you need an active cookie, so log into your zenphoto session from your browser.(If you try to debug in the publishing wizard it wont throw php errors back at ya)
then you have
http://url.com/zenphoto/xp_publish.php?cmd=publish
from there you should be able to troubleshoot
I can see if I can take a look at it tomorrow sometime since I am already familiar with it too if you dont figure it out by then. I havent installed 1.1.5 yet so I havent had a chance to take a look at the changes but when I updated the wizard from the previous version to the current, I just took the admin page upload function from zenphoto and worked it into the wizard if that helps you at all. I wouldnt imagine you still wouldnt be able to do the same.. but like i said.. i havent taken a look at it yet.
`--- C:Junkxp_publish.php 2008-01-13 17:01:00.000000000 -0800
+++ O:testalbumhtdocsxp_publish.php 2008-03-02 09:55:54.000000000 -0800
}
function form_album($message = '') {
global $gallery;
$gallery = new Gallery();
- $albumlist = array();
- genAlbumList($albumlist);
+ $albumlist = genAlbumUploadList($albumlist);
$this->header();
echo '';
echo 'window.totalinputs = 5;';
function process_login() {
if (isset($_POST['user']) && isset($_POST['pass'])) {
$user = $_POST['user'];
$pass = $_POST['pass'];
$check_auth = md5($user . $pass);
- if ($user == getOption('adminuser') && $check_auth == getOption("adminpass")) {
+ if (checkAuthorization($check_auth)) {
setcookie("zenphoto_wizard", md5($user . $check_auth), time()+5184000, $cookiepath);
- $_zp_loggedin = true;
} else {
setcookie("zenphoto_wizard", "", time()-368000, $cookiepath);
}
}`
I dont think checkAuthorization() is returning anything or is returning no rights.
if I leave the
`$_zp_loggedin = true;`
in the process login, it takes me to the upload form but it doesn't show me any folders.
If I open zenphoto in another tab and go to my admin url and log in, then go back to my wizard tab I can get the album list to populate. at that point if I make a new folder, it will create the folder but it wont upload the picture. that might be another problem but I want to make sure the authorization is correct before go further into that..
sbillard:
after importing the regedits:
In XP you need to have to folder task turned on in Windows explorer. This is the blue task bar on the left. Then if you go to a folder with pictures it in, if you select a folder it will say "Publish this folder to the web" and if you select a picture it will say "Publish this file to the web"
In Vista you need to open Windows photo Gallery and choose Order Prints and select your gallery.
Any help is appreciated. Any other ideas as to why i might not be getting the authorization I am supposed to be getting? I have been in front of this for about 5 hours now.. I need to step away for a while and come back to it.. I am not thinking straight anymore.
`function process_login() {`
`global $_zp_loggedin;`
`if (isset($_POST['user']) && isset($_POST['pass'])) {`
`$user = $_POST['user'];`
`$pass = $_POST['pass'];`
`$check_auth = md5($user . $pass);`
`$_zp_loggedin = checkAuthorization($check_auth);`
`if (!$_zp_loggedin) {`
`zp_setcookie("zenphoto_wizard", "", time()-368000, $cookiepath);`
`} else {`
`zp_setcookie("zenphoto_wizard", md5($user . $check_auth), time()+5184000, $cookiepath);`
`}`
`}`
`if ($_zp_loggedin) {`
`$this->form_album();`
`} else {`
`$this->form_login('The username or password you entered are not correct');`
`}`
`}`
It logs me in (and yes I cleared all my cookies and browser cache to make sure everything was fresh and clean)but it logs me in and I can see my folders. but after I select my folder and hit next, it takes me back to a logon screen.. I am tired.. and it is not obvious to me.. maybe someone can pick out why it doesnt hold my credentials.
`function authorize() {
global $_zp_loggedin;
if (isset($_COOKIE['zenphoto_wizard'])) {
$saved_auth = $_COOKIE['zenphoto_wizard'];
if ((!$_zp_loggedin = checkAuthorization($saved_auth)) & UPLOAD_RIGHTS) {
setcookie("zenphoto_wizard", "");
}
}
}`
The & UPLOAD_RIGHTS should also go on the if `($_zp_loggedin)` lines `if ($_zp_logged_in & UPLOAD_RIGHTS)` and the login message should be `$this->form_login('The username or password you entered are not correct or you do not have upload rights');`
But, I am wondering why we are not letting the `auth-zp-php` file handle the login and authorization. Then there would be no need of the extra cookie. All that should be need is to add
` echo "n ";
echo "n ";`
to the xp_publish login form. The auth-zp will process the login. `$redirect` should be set to the url for xp_publish.
If we do this, all that is needed is to check `$_zp_loggedin` to see if we are logged in with appropriate rights.
I found the publish to web. (I never run with the folder tasks visible!). But, All that I have is the MSN stuff for a place to publish. The zenphoto album does not show up.
On top of it all, my computer crapped on me yesterday(power supply), just got myself back up and working. I am gonna keep working on this but like sbillard said "Its broken much more than you think by v1.1.5"
Also note that the newer file upload uses the lib-soe.php function `seoFriendlyURL()` function to cleanse "bad" characters from the filename before the upload.
Sorry about your commputer. Let me know if there is anything else I can help with. (Just wish I knew how to get the publish wizard to recognize the zenphoto album.)
It's kind of funny, but I've been practically pulling my hair out trying to get this to work after upgrading figuring I'd done something wrong (and my wife was going to kill me). Is it politically correct to be thankful this is actually a coding problem?
Not sure what help, if any, I can offer on coding front, but if there's anything I could do to assist, I'd be glad to.
wrong:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\PublishingWizard\Providers
right:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\PublishingWizard\PublishingWizard\Providers
Putting the key in the correct area gives me the server in the list, but my login/password don't work.
My latest status is:
I am pretty confident I have everything updated and working properly, the photo's just dont upload, but it spits no errors(because xp/vista publishing wizards hide the errors) Once I get my computer running i dont suspect it will take much longer, just hasnt been a real priority.
If anyone else wants to take a look at it I can see pull out my HD and pull the files and post them.