21
prophecy100
Re: Just a little request this time!

Here is the script I wrote to do what I needed, you could modify it very easily to copy out any information you wanted.


<?php
//MySQL Main DB Connection & Selection
$conn_main=mysql_connect("dbhost1", "dbusername", "dbpassword");
mysql_select_db("dbname",$conn_main);

//MySQL Gallery DB Connection & Selection
$conn_gallery=mysql_connect("dbhost2", "dbusername", "dbpassword");
mysql_select_db("dbname",$conn_gallery);

//Delete from Gallery DB
$delete_sql="delete from gallery_users";
mysql_query ($delete_sql,$conn_gallery) or die (mysql_error());

//Select data from Main DB (Outer Loop)
$totalsql="select uid from xoops_users order by uid desc limit 1";
$totalquery=mysql_query($totalsql,$conn_main);
while ($totalrow = mysql_fetch_array ($totalquery)) {
$totalcount=$totalrow['uid'];
}

$loopcount1=1;

while ($loopcount1 <= $totalcount) {

$xoops_sql="select uid,uname,pass from xoops_users where uid=$loopcount1";
$select_sql=mysql_query($xoops_sql,$conn_main) or die (mysql_error());
while ($row1 = mysql_fetch_array ($select_sql)) {
$phpuname=$row1['uname'];
$phppass=$row1['pass'];
}

if(isset($phpuname)) {
$gallery_sql="insert into gallery_users values ('$phpuname','$phppass')";
$insert_sql=mysql_query($gallery_sql,$conn_gallery) or die (mysql_error());
$loopcount1=$loopcount1+1;
unset($phpuname);
unset($phppass);
}

else {
$loopcount1=$loopcount1+1;
}
}

//Close MySQL Connections
mysql_close($conn_main);
mysql_close($conn_gallery);
?>


Jonathan



22
prophecy100
Just a little request this time!

Hello all

I have written a little php script that copies the users username and password out of xoops_users and into a table in another database.

What I need to do is run this script when ever a new user is created, any idea where I should call this or where I can copy the code to in an existing XOOPS page to make this happen?

Thanks all,

Jonathan



23
prophecy100
Login across domains

Hello all

I thought I remembered reading something about this a while ago but I can't seem to find it. Is there anyway a login could persist across domains, i.e. if the user logged in at www.mysite.com, and a link took them to blah.mysite.com that they could stay logged in?

As ever any help is very much appreciated.

Jonathan



24
prophecy100
Remote hosting of photos

Hello all

I know I am asking a really arkward question here, but here it goes....

Does anyone have any idea if I could use any existing gallery modules to host my photos on a different server from Xoops. I.e. I have my XOOPS and DB on one server and I would like to host the pictures themselves on a different server and link to them appropriately.

Anyone ever tried anything this wierd before?

Thanks

Jonathan



25
prophecy100
Re: Admins registering users

I have now managed to achieve this, I don't know if this will be of use to anyone else but I thought I would post it here just in case it was.

Was I did was create my own blank user registration module. I.e. Just the index.php and xoops_version.php pages. I then changed the paths of the included files in register.php to compensate for the new location and moved this to the module directory.

I then just had to grant the correct user group access to this module. Thats it, admins can now register users.

Jonathan



26
prophecy100
Re: Admins registering users

Thanks Herko

You are of course right, the only problem is when the user hovers their mouse over the system admin button they see all the links (avatars, blocks, templates, etc...) that they don't have access to.

While it is true that when they then click on one of them they can't access it, they still see the menu option.

Is there anyway I can hide these extra popup menu options or call the admin userform without the rest of the admin interface?

If i'm not making sense then let me know

Thanks

Jonathan



27
prophecy100
Admins registering users

Hello all

I am redeveloping a website for my Scout Group. I would like only group members to be registered users of it. I have turned off new user registration and instead will create logins myself.

I would like to give other group leaders the ability to create user accounts but without them seeing the full administration interface. Does anyone know of a way I can create a standalone page or form that would create new user accounts without going into the admin interface?

As ever, any suggestions very much appreciated.

Jonathan



28
prophecy100
Re: Where can I download SPAW Editor for Xoops?

Catzwolf's spaw editor is also included with the wfsections module. It is a zip file containing both, you can download it from the following link

http://www.macambridge.com/modules/mydownloads/singlefile.php?lid=1



29
prophecy100
Incorrect Redirection Problem

Hello all

I am having a small problem that I hope someone here can help me with.

I have XOOPS installed in a directory called portal, i.e.http://mydomain.com/portal, I also have a seperate login page outside this structure,http://mydomain.com/login.htm. I have inserted the following code at the top of index.php to redirect the user to this login page if they are not logged in:

if ( !$xoopsUser ) {
redirect_header("http://mydomain.com/login.htm");
exit();
}

This works fine if the user tries to go to the index page, however if the user tries to go to another url, for examplehttp://mydomain.com/portal/modules/articles/index.php then XOOPS seems to go into a direct loop. The user is told they do not have access (which is correct) and then they are redirected to nowhere. XOOPS tries to redirect but all that happens is the URL gets longer and longer and it seems to continually loop. Below is an example of the url this creates.

Does anyone know where I can change or specify the redirect location. I tried altering a couple of lines in includes/checklogin.php which referred to INCORRECTLOGIN but this didn't seem to have any effect.

Any ideas?

Many thanks

Jonathan

URL Example-

http://mydomain.com/portal/user.php?xoops_redirect=%2Fportal%2Fuser.php%3Fxoops_redirect%3D%252Fportal%252Fuser.php%253Fxoops_redirect%253D%25252Fportal%25252Fuser.php%25253Fxoops_redirect%25253D%2525252Fportal%2525252Fuser.php%2525253Fxoops_redirect%2525253D%252525252Fportal%252525252Fuser.php%252525253Fxoops_redirect%252525253D%25252525252Fportal%25252525252Fuser.php%25252525253Fxoops_redirect%25252525253D%2525252525252Fportal%2525252525252Fuser.php%2525252525253Fxoops_redirect%2525252525253D%252525252525252Fportal%252525252525252Fuser.php%252525252525253Fxoops_redirect%252525252525253D%25252525252525252Fportal%25252525252525252Fuser.php%25252525252525253Fxoops_redirect%25252525252525253D%2525252525252525252Fportal%2525252525252525252Fmodules%2525252525252525252Farticles%2525252525252525252F



30
prophecy100
Htaccess auto login

Hello all

My installation of XOOPS sits in an area of the website secured with an apache htaccess file. Users have to enter a username and password to access this area.

Does anyone know of an easy way I can set up XOOPS so that it automatically logs a user in using the username and password they entered to gain access to the secure area?

I have looked at the autologin hacks, authentication hacks, etc. I know that htaccess can reference a MySQL database and I have got this to work, I also know that two variables, php_auth_user, and php_auth_pw are set when a user logs into the secure area. From everything I have read i'm pretty sure this should be possible but i'm a little confused over what I would need to do...

I would really appreciate any help anyone can give.

Jonathan




TopTop
« 1 2 (3)



Login

Who's Online

157 user(s) are online (90 user(s) are browsing Support Forums)


Members: 0


Guests: 157


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits