sNews Forum

Previous sNews versions => sNews 1.4 Final => Mods and Addons => Topic started by: George Antoniadis on April 13, 2006, 08:40:49 pm

Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: George Antoniadis on April 13, 2006, 08:40:49 pm
mySQL Multi User Mod for sNews 1.4 (mod version 0.2b)
*Updated on 15/4/2006 - 13:17 GMT

Announcements:
List:
·This is the first public version for sNews 1.4
·This is a beta version and might have bugs.
·Please report them here so they can get fixed.
·Please DO NOT post code in this thread.
·BACKUP BOTH YOUR FILES AND MYSQL TABLES BEFORE ATTEMPTING TO INSTALL THIS MOD.

What it can do:
List:
·There is one admin user that can add/edit/delete users.
·You can have as many users as you want.
·Users cannot add/edit/delete users.
·Users and admins can change their password.

What has to be added:
List:
·Users to be able to retrieve their password via email.
·The admin to be able to assign users to be able to post only to specific categories.

The option for the admin to create other admins via the admin panel (currently s/he can add other admins only via phpMyAdmin)[/li][/list]
·Suggestions are welcome

How to install:
Insert this to your mysql:
Code: [Select]
--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(3) unsigned NOT NULL auto_increment,
  `username` varchar(150) NOT NULL default '',
  `password` varchar(150) NOT NULL default '',
  `email` varchar(250) NOT NULL default '',
  `mode` enum('admin','poster') NOT NULL default 'poster',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=2 ;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `username`, `password`, `email`, `mode`) VALUES (1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'admin@domain.com', 'admin');
*Please remember to add the table prefix in "CREATE TABLE" and in "INSERT INTO" if you are using one.
ex.
Code: [Select]
CREATE TABLE `prefix_users` (and
Code: [Select]
INSERT INTO `prefix_users` (Download this: (Edit - URL removed Sept.22.07, no longer active)

The default username/password is admin/admin

Rename your snews.php to something else, take the config values of your snews.php and replace them on the new one.
* The reason for releasing this as a file is so to keep an archive of the versions, make sure that ppl don't leave out stuff in copy/paste actions, and make this post smaller if you are not interested in the actuall file.
* Everything that has been changed can be found between:
//USERDB START
//USERDB END


If you want to be notified about updates of bugfixes for this MOD you can enable notify on this thread.
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Shaun Aneiros on April 13, 2006, 09:00:03 pm
Ok!!!

Now, can we get an email when someone other then the main admin posts?

Oh sooo needy...
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: George Antoniadis on April 13, 2006, 09:27:19 pm
I don't think so! o_O
Lukas any ideas on that?

Saneiros if you try it out please let me know how it's comming. ^_^
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: bramsyuur on April 13, 2006, 11:08:09 pm
@all:
Only one apreciation;

- In order to work, you need to add these two rules into your .htaccess file:

Code: [Select]
RewriteRule ^new_user/$ index.php?category=new_user [L,QSA]
RewriteRule ^user_changepass/$ index.php?category=user_changepass [L,QSA]

Good work, guys!
bramsyuur.
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: George Antoniadis on April 13, 2006, 11:35:33 pm
it should work without these but you could do that too~! ^_^
thnx! :D
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: bryn on April 15, 2006, 11:35:16 am
WOW!!!

I sure hope this works with all my other mods included..if so what a great addition to sNews..you've excelled yourself here 'a'..fantastic mate ;)
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Patric Ahlqvist on April 15, 2006, 11:38:07 am
WWHHUUUUUUUUUUUUHAAAAAAAAAAAAAA Analyzerx, my man, buddy, pal, friend, your a greek GODESS, hehe... You're my Athena, mo'n. LOL... Oh if this works and the other features is comeing along you're definitivly 25 euro's richer. (Half of the price money for multi user and an inplemented image gallery).

I will download and masturbate with this today...Whne I've woken up a bit. Now I can barely see the screen. Do you have a test site??

PS 1 - I might be a dumba$$ or just too tired from just waking up...but I need help on IRC or MSN to set up those tables... I get error messages the whole time....

I'm on both right now, and for some time onwards... If I do not answer, I'm just at the crapper ;)

Patric.

PS 2 - deleting all posts that have no baring on the MOD, in order to keep this thread as clean as possible. (will delete this aswell later.)
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: George Antoniadis on April 15, 2006, 02:13:20 pm
BUGFIX: 'Change password' was visible always.
* new version posted on first post. (02b)
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: bramsyuur on April 15, 2006, 10:37:14 pm
@Analyzer:
I've been playing with this version... and I don't have find any bugs in it... only 2 comments/suggestions about this
great addition:

The 1st:
- I think that only the admin need to be able to erase articles, comments and every thing... not users!!!  With this mod,
actually, any user are able to erase every thing that she/he wants... is a serious risk, I think that only the user are able to
erase/delete their own articles post, and their comments relative to your articles. I think...

The 2on:
- A possibility to create a new entry into 'New Articles' that mean 'Write your name in a bottom of article?... bla bla".  I think this is a good adition for a multi-users snews.

Edited: Another suggestion, multi-login capabilities to log into snews whitout loss the other user side (actually, I loss the connection when another user take login into the snews).

Thanks for this great effort in this Mod!!!
bram.
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: George Antoniadis on April 16, 2006, 02:05:36 am
@brams:
Thanx for all your help mate! ^_^

1. About the admin only being able to erase articles I'll try adding some more options to users, add/edit/del articles/comments/cats so each user can have diff stuff...
2. About the name I wanted to do this but totally forgot hehe! :P - tnx
3. About the login thing I haven't tried it but most likely a session thing. I'll make a diff set of sessions for each user. ;)
4. Patric suggested a instant message thing that I'm trying now...
5. New stuff are new email password retrieval thingie and want to see if it's possible to make a user add/edit/del stuff on one category without changing all snews code! :P

My oncy concern is that once all these mods are in place I'll have a really hard time implementing it into the next snews versions and little time! o_O So I'm trying to figure a way to do this without me killing myself! :P hehe

Thanks everyone! ;) esp brasm and patric
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Patric Ahlqvist on April 16, 2006, 09:46:23 am
Analyzerx - would this be anything to take in consideration ? http://solucija.com/forum/index.php?topic=790.0
Made sense to me...
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: George Antoniadis on April 16, 2006, 11:57:15 pm
yeah patric it does... but I think this should be also included in the next version... o_O
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Patric Ahlqvist on April 25, 2006, 04:07:23 pm
Oh... just realized something ;)... Haven't bugged you bout the expected release date :) Anything new on this front, George ? Have you had any time to explore the wonders of multi user log in anymore ?
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: George Antoniadis on April 26, 2006, 09:52:13 pm
Sorry internet here is fucked up and I was pretty busy... o_O

really sorry... I'll have the version final until saturday... many new stuff promice! :>
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Patric Ahlqvist on April 27, 2006, 11:59:04 am
No need to feel sorry... You're doing all the work and I'm just craving ;).... I'll wait patiently for it...
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: brauck on May 06, 2006, 11:13:12 am
At the image upload you can upload almost everything, including *.php and *.js

In a multi-user environment shouldn’t the upload, for safety reasons,  being checked and only allow images or pdf’s (or by admin approved extensions)  to be uploaded?

EDIT

analyzerx, I just saw your post on this just now (http://www.solucija.com/forum/viewtopic.php?id=833). The best thing is to take care of the safty-thing is here I guess?
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: George Antoniadis on May 10, 2006, 09:52:24 am
the problem is that real life has caught up with my bank balance so I need to get my ass down to get some money ASAP so priorities are some projects I have to finish for $$! o_O

Luka is working really hard on the next snews version that is comming to be AWESOME, so I can't get into the mess of re-writing the code for the mods before luka finishes the base for the new version...
A LOT of his time and effort has come into cleaning up the code and splitting the code admin from the interface...

Current mods will need to be altered and mods of this magnitude will have to be re-written! :/

really sorry for this.
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Patric Ahlqvist on May 10, 2006, 12:31:16 pm
Ahh, but this explanation is good. Now I and others with me can "back the f-word of" ;).

This version Lukas doing, are you implying or even saying strait out that the mods I'm using today (image resizing, SPAM-protection, and the multi user mod obviously) all needs to be re-written to fit the new version ???

Patric.
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: gomisan on May 10, 2006, 01:40:19 pm
It's most likely that any mods will need to be 're-implemented' and that will inevitably involve code changes.
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Zucye on September 14, 2006, 02:06:58 am
Will we have something like this for the new version 1.5?

or will this work with the new version?
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Keyrocks on September 14, 2006, 03:49:42 am
Quote from: Zucye
Will we have something like this for the new version 1.5?
or will this work with the new version?
Have you already applied it to 1.4? If not, give it a shot - it worked OK for me a few days ago. Then, once you have it working in 1.4, explore 1.5's snews.php file and see if you can find similar function locations that may be the same or as close to the same as where the mods went in 1.4... and try adding them in 1.5... and test it out. Remember... comment out sections before modding them, then copy the section and use that for your modding... so you can always revert to the untouched scripts if it doesn't work. Doing is more fun than waiting for someone else to do it, eh? :)
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Patric Ahlqvist on September 14, 2006, 07:30:24 am
Hehe, you're so wise, Key... I actually have tried doing this with all the mods I want, but alas, my love... I can do but wrong. It's too complexe for me anyways, but it's really fun trying - So, true, man.

OT - No, this is not a part of sNews 1.5 - and it will not be. The core will stay intact as a lightweight, single file system, and will not contain hardass modifications, they have to be...well, just that - MODS. And our hopes are set to Analyzerx's return, I think. Specially regarding this particular MOD... It's his baby...

But George is still busy, I think. He's not been on the forum for ages... So, we'll have to await and see..
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Jesús Ramírez on September 18, 2006, 11:20:43 am
This MOD is aplicable to snews 1.5?
Of all forms I am working to see if it works.
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Patric Ahlqvist on September 18, 2006, 11:35:16 am
Not just yet, Jramirez
Title: [MOD] mySQL Multi User Mod v0.2b (sNews 1.4)
Post by: Fotrane on September 25, 2006, 07:24:20 pm
I'm working on porting this over to 1.5, but still looking working through the changes regarding how forms are processed (i.e. html_input(), etc.). If anybody has gotten beyond this point, I'd be glad to contribute as this is a very useful mod.