Welcome Guest, Not a member yet? Register   Sign In
Help a newbie day
#1

[eluser]Unknown[/eluser]
Hi everyone. I've just joined the CI forums and I am looking for some advice.

First off let me say I have some basic experience in PHP and have made a couple of dynamic websites - but coding PHP in such an ad-hoc fashion can get tedious and a bit messy, hence me looking for a framework :-)

I've been reading up on PHP frameworks and the ones that stood out for me seem to be CakePHP and CI. I've installed both but for some reason CakePHP seems to take ages to load pages on my local server, so I'm playing with CI for now.

I have a project to complete in which I have to make a social networking site for PhD students and also include a section for supervisors to monitor their progress, and I am wondering how to go about implementing this in CI.

In order to get a basic structure to work from I need to start implementing the various user areas and I have identified 5 user levels, however what has me stumped is how to implement these taking into account the framework.

These user levels are:
global admin (no restrictions)
admin (to register a university - needs to be approved by global admin)
dept. head (to register a department - needs to be approved by admin)
supervisors (need to be approved by dept. head)
students (regular users)

Normally I'd just do mysql query and depending on the usertype value in the database, redirect to the relevant section - however researching into this in context with CI I'm hearing things about ACLs and integrating Zend into CI and it's a bit confusing for me at the moment.

Can anyone give me a push in the right direction?

Thanks
#2

[eluser]mortifrog[/eluser]
Hi buddy - sorry I can't help you - I'm in the same boat as you - that is, our experience level and needs seems similar. I want to build a particular type of CMS.I also want a 5 tier heirachical admin structure. I'm only two days into this, I'm going to read the manual again, because it takes a while for the penny to drop! I'm having trouble thinking about how to organise the architecture. In old school PHP, my content would just be included into the index page depending on the $module value in $_GET or $_POST. Should we use includes at all with CI? It seems to me also that it is impossible to separate the PHP from the HTML 100% - but that's probably neither here nor there. Anyway, good luck - I have a couple more questions, but I don't want to hijack your thread - just wanted you to know that I have the same problem and will be watching here to see what the kind Elders say ;-)
#3

[eluser]aroman[/eluser]
I think Freakauth light can be helpful for your project. Take a good look at it
Heres the link.

cheers Smile
#4

[eluser]mortifrog[/eluser]
Sorry D756 for replying before you. Freakauth looks very useful though not sure whether I will use it yet or write my own. It seems like it's getting to the point where we soon won't have to write any new code at all - just piece together bits of OS to make what you want - lol. But I'd really rather write a lot of my own code! Thanks for the reply. I wonder whether it would be easy to integrate my own Captcha, Clockedya with Freakauth - admittedly I think I would need to rewrite it as an object.
#5

[eluser]Jeffrey Lasut[/eluser]
@mortifrog
Before you start building your own CMS take a look at some open source options:
- http://blaze.haughin.com (CMS in CodeIgniter)
- the most popular CMS at this moment http://drupal.org

If you decide to create your own CMS, take a look at the features off some open source options.

For creating own library's take a look at the user guide:
http://ellislab.com/codeigniter/user-gui...aries.html
#6

[eluser]mortifrog[/eluser]
Thanks Jeffrey - I am familiar with most of the popular CMS systems. I have several reasons for wanted to create my own.

1. I have very specific needs which are not met by any CMS that I've come across.

2. It will improve my coding.

3. It will improve my career prospects.

4. It will give me an enourmous sense of achievement.:-)
#7

[eluser]BenJaminJ[/eluser]
I've been programming all my life. One thing I've learned -- is that when someone else has spent the time correctly building a library, I'm not going to waste my time replicating it. And it could be hugely deflating to you, not having a strong handle on PHP and dealing with one of the messiest things out there for a new programmer -- authentication.

If I thought it would vastly improve your skillset and be a blast implementing -- I'd tell you to go for it. But you won't, so I won't.

Having said that, check out DX-Auth. It's a great little plug-in that will get you going with your levels of administration in about an hour. Once done, you can focus on the business rules of your social site, rather than figuring out why sessions aren't playing nicely.

Learn from us old bears, we've learned a thing or two in our days.
#8

[eluser]mortifrog[/eluser]
Sorry, but I believe I've got a reasonably strong handle on procedural PHP - just not OO or CI. I've been tinkering with code for just a little while myself. (started out doing Z80 & 6502 assembley 25 odd years ago) - but I've only been doing PHP for 7 years. (admittedly, I've been a little slack and only bothered learning what I needed to learn when I needed to use it) :-)
I now need OO and frameworks - so I am learning that.

I've written several authentication systems. Being pig headed, I think I will use my own because it works the way I want it to work. ie:

A user or an admin can log in with either their screen name or email address.

If an admin logs in with his email address and he has a user with the same email address - he gets logged into his user and his admin account simultaneously. (though users and admins are kept in separate table)

It uses my own Captcha code

It logs and alerts me in the case of hack attempts as well as auto-banning after x number of failed attempts, first by putting IP in temporary ban table a refusing to serve content and if IP persists trying to hack - by appending .htaccess

It uses a Clearance Level system - so is pretty flexible in the number of levels it can use.

So can this auth you recommend be configured to work the way I want. If yes - then great - I'll give it a shot, if it's gonna be a big hassle to hack it, then I may as well write my own.

I'm not particulary initimidated at the prospect of writing my own auth system. I hear what you're saying though and I'm not opposed to using tried and tested code in place of my own for parts of my system that I don't require to work in any special way -for instance an emailer - it's one of the reasons I chose to use CI.

If I pieced together my whole CMS with other people's libraries though - I don't think it would look or feel too unique or have any original functionality.

As you say - don't re-invent the wheel if you don't have to. On the other, if you have specific needs that aren't met by what already exists - that's why it's called programming. Thanks for your <input>.
#9

[eluser]cahva[/eluser]
I think theres nothing wrong converting your old code to take advantage of CI. And if you are "neat" coder, it wont take long to transform your functions to usable helpers and libraries. I discovered (and fell in love, baby!) CI last spring and now have converted many of my apps and libraries to CI. I too needed an auth system and have experimented with almost all of them that I have found in these forums and wiki. Unfotunately none of them(even DX "your search for auth system is over" Auth Smile) did not satisfy our needs so I borrowed some ideas from here and there and now I have an auth system that we will use on our project(s).




Theme © iAndrew 2016 - Forum software by © MyBB