Jump to content

Recommended Posts

The phase of the project is code the Admin Panel:

 

My first question is: I've made different levels of administratives rights, what will be the best way to show the correct panel depending on user level? (Administrators, Moderators..etc)

 

 

Second: I want to populate a drop down box with a color array/list, how would I do such thing? Will be possible to populate it with color example?.....I'm using this color list:http://www.phpfreaks.com/forums/index.php/topic,115201.0.html

 

 

and Third: Which encryption method is recommended? MD5 or Sha1?

 

If it's possible can you post an example? :)

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/144274-few-questions/
Share on other sites

You will need (2) tables

 

1 user table

 

contains user related information...

 

user id

group id

other groups

usename

password

reg date

last login

birth day

....

 

2 group table, relationship shared with the user table using group id

 

group id

group name

editing permissions

posting permissions

upload permissions

.....

 

The other question...

 


echo "<select name='colors'>";

foreach ( $colors AS $k => $v )
{
echo "<option value='" . $v . "'>" . $k . "</option>\n";
}

echo '</select>';

Link to comment
https://forums.phpfreaks.com/topic/144274-few-questions/#findComment-757137
Share on other sites

I got lost with this part...I just include the file and this script will make the rest?

 

echo "<select name='colors'>";

foreach ( $colors AS $k => $v )
{



echo "<option value='" . $v . "'>" . $k . "</option>\n";
}

echo '</select>';

 

Also, in this part I will "write" stuff like TRUE or FALSE? or theres a better way?

 

group id

group name

editing permissions

posting permissions

upload permissions

Link to comment
https://forums.phpfreaks.com/topic/144274-few-questions/#findComment-757146
Share on other sites

Like so... include the other page you linked to like so...

 

<?php

// path and file name where that colors array file is located

include_once './colors.php';

echo "<select name='colors'>";

foreach ( $colors AS $k => $v )
{
echo "<option value='" . $v . "'>" . $k . "</option>\n";
}

echo '</select>';

?>

Link to comment
https://forums.phpfreaks.com/topic/144274-few-questions/#findComment-757150
Share on other sites

For encryption - I do add the username + salt + password.

That way when 27 different users all think xyzzy (or plugh ... ;)) is a good password, the hash is different.

If you don't require case sensitive login, remember to strtolower on the login before making/validating the hash. Also it means they can't change their username w/o a password reset, but that's life.

 

Using the username with the salt when making a hash avoids situations where an sql injection that dumps the hashes allows the cracker to try the most common passwords with the accounts that have an identical hashes, because identical passwords won't have identical hash.

 

As far as which to use - do a double md5 or double sha1 - doesn't matter.

Link to comment
https://forums.phpfreaks.com/topic/144274-few-questions/#findComment-757161
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.