aMule Forum
English => Feature requests => Topic started by: fulgas on November 22, 2005, 12:18:05 PM
-
Any chance of having mysql support on the php?
why do i want that?
Simple....
Multi user webserver interface.
It will not change anything on the daemon. It will all be done on the webserver.
I have already changed the webserver to allow more than 1 user. And it works.
-
Explain in details what exactly kind of relationship with mysql you would like to have. Amuleweb is not generic purpose web server, and php engine there is not competitor for Zend products.
It is possible from technical side of view, but there must be good reason to enter such adventure.
I have already changed the webserver to allow more than 1 user. And it works.
Good for you, but again you aren't explaning what exactly you mean. May be you can post patch against current snapshot ?
-
Originally posted by lfroen
Explain in details what exactly kind of relationship with mysql you would like to have. Amuleweb is not generic purpose web server, and php engine there is not competitor for Zend products.
It is possible from technical side of view, but there must be good reason to enter such adventure.
I have already changed the webserver to allow more than 1 user. And it works.
Good for you, but again you aren't explaning what exactly you mean. May be you can post patch against current snapshot ?
I will explain what i intend to do.
Currently amule only have support to 2 types of users on the webserver. I have change the code a bit to get on a mysql table the username and level of the users. So the webserver now has support to several users.
Using the sessions vars i know which user and level have entered the pages.
What i intend to do is just have the php with mysql support to get a list of hash of the files that each user started the download thru the webserver.
So i can give rights to each user and know which user started a file.
Quite simple.
i think.
-
I will explain what i intend to do
And it works
I am confused. You already implemented it or waiting for for amuleweb to support ?
Anyway, here comes technical side of mysql support:
1. Such code will definitly include mysql headers and as a result will need compile-time switch
2. Complicated configuration options
3. Last time I wrote SQL was about 10 years ago
4. I have no idea how "regular" php connects with mysql and have quite low motivation to lear it.
5. AFAICT you (or me) will have to rework amuleweb login code in c++ side to allow control thru php
6. Old templates will not work with all above
7. Other issues that I did not thought about
Beware, that (6) is quite serious issue and you have to deal with it. My personal opinion - this is bad idea: very complicated implementation, complex setup, very limited usefullness. But, if you think different (and you clear are) please come out with some kind of implementation proposal, and we will discuss it.
-
I propose using categories, and user-level control of which categories to show.
-
Originally posted by lfroen
I will explain what i intend to do
And it works
I am confused. You already implemented it or waiting for for amuleweb to support ?
Anyway, here comes technical side of mysql support:
1. Such code will definitly include mysql headers and as a result will need compile-time switch
2. Complicated configuration options
3. Last time I wrote SQL was about 10 years ago
4. I have no idea how "regular" php connects with mysql and have quite low motivation to lear it.
5. AFAICT you (or me) will have to rework amuleweb login code in c++ side to allow control thru php
6. Old templates will not work with all above
7. Other issues that I did not thought about
Beware, that (6) is quite serious issue and you have to deal with it. My personal opinion - this is bad idea: very complicated implementation, complex setup, very limited usefullness. But, if you think different (and you clear are) please come out with some kind of implementation proposal, and we will discuss it.
I only implemented the login issue for more than one user using the mysql as backend.
I have look to your php code i think i can manage to implement some mysql features on that.
Yes, old templates are working on that... just need to disable the UseMySQL flag. At least the way i did it...
You can check on http://fulgas.dyndns.org
user/pass => fulgas/fulgas
the changes i did on remote.conf
UseMySQL=1
[MySQL]
DbHost=127.0.0.1
DbUser=fulgas
DbPass=******
DbName=aMule
I propose using categories, and user-level control of which categories to show.
that's a though... Haven't though how user-level will work.
-
I only implemented the login issue for more than one user using the mysql as backend
So why not share the code with us, so we will have an idea what are you talking about ? I'm getting the idea that you don't really need mysql on php side, but on c++ side where login and data transfer takes place.
And my opinion about it - wtf you need a full blown relational database here?. Simple comma separated text file will do just fine. Remember /etc/passwd ?
If you DO need mysql on php side, collaborate little more and explain your ideas :)
-
Here is the patch...it's done against the 20/11 CVS.
-
Now I've got an idea. And my opinion remains: you don't need relational database to hold user-password pairs. Using YP or PAM or comma-separated file would make sense thou.
Sorry, patch rejected.
-
well when I am back home I try it and see how good and well it works.
but a complete mysql server for just storing user/pass seams a bit overkill
-
Well, that patch was never intended to be commit :)
Anyway, the mysql is not for store user/pass only.
It's to keep a relation between user/hash of file so that it doesn't load the aMule daemon or neither have major changes on how it works.
So it's all done in the webserver.
A lot of features can be added with mysql support but that's will someday be done.
I guess.
:)
-
It's to keep a relation between user/hash of file
Even for this you don't need heavy sql server. You need std::map >.
In your patch I can't find how do you handle download of file from search results ? How you know who is the user started search ? How do you handle situation when 2 users what same file - you can't put it to download queue twice ? Who is managing shared files ?
I can keep asking those questions all day long, but my point is simple - [a,e]Mule is application designed for single-user environment. But - this is out of scope of this discussion.
A lot of features can be added with mysql support
Someone here already proposed to implement xml/soap support. He (or she) used same argument with mysql replaced with SOAP. And failed completely to bring even 1 (one !) example of such feature. May be you will do better - bring an example of some usefull feature which need access to some kind of SQL engine.
-
the patch is not complete... I never said it was...
the patch only deals with login for more than one user. It can be done other ways.
the rest i will do when the time comes if possible, otherwise it's just way to learn how amule works and playing on the code. :)
No harm on that.
-
There is a deamon, so multiuser isn't far in my mind, too. The problem with the two same files can be solved by downloading it once, and copy it twice (once for each user).
-
I understand what fulgas wants to achive.
Let me give you an exampel so you can see why it might be a good feature.
I'm student and i live in a house with 2 other ones. everybody has his own mule runnig what is quite
stupid. why we don't use one? nowbody wants that the other can see what kind of porno you are downloading at the moment :rolleyes:
With fulgas idear you can solve that problem. let me call it a multi user support for the webinterface.
I woud be very happy if that feature comes.
But I am also on that opinion that a mysql soulution would be a bit blwoted. A simpel text file will do...
-
nowbody wants that the other can see what kind of porno you are downloading at the moment
Ok, I will say this again. Only 1 (one) time can file be put in download queue. When 2-nd student will attempt to download same porn, that 1-st already downloading, amule will tell him nicely: "no,no, you can't have it - another user downloading it".
Same thing happens with shared files and searches.
Now, I'm not against an idea of such "multiuser webinterface". I'm against using mysql for holding list of hashes.
-
When 2-nd student will attempt to download same porn, that 1-st already downloading, amule will tell him nicely: "no,no, you can't have it - another user downloading it"
Yes, you are right of course but this is only a problem in case of 2 users. For that i have no solution.
But for more than 2 users you simpley don't tell the username of the other person downloading the file.
And the example with the porn was just an extreme one. I generally like to keep my personal data private even if i'm downloading suse.
I also want to say, that I am just for a multi user support for the webinterface. In my optinion this is not a problem. Root can also read and write ~/ from all users.
-
Yes, you are right of course but this is only a problem
Unfortunatly, this is on only problem, but this a major one.
example with the porn was just an extreme one
Yea, right.
Root can also read and write ~/ from all users
So what ? amule(d) is not running as root. So, how exactly you manage to write, set owner and permissions of files in other users directories ?
-
You can work with groups.
Each User has his own group and incoming dir with Sticky bit set and write permissions for his group on that. One separate user that runs amule is in all groups of the users.
And if you download 2 files at the same time, you can just download one, and give a copy to the second user.