Jump to content
php.lv forumi

Lietotaj Pieejas Limenis


Faks

Recommended Posts

if(!$_SESSION['logged_in'] and $_SESSION['u_level'] != 4 and $_SESSION['u_level'] != 2)

Labdien Damas un Kungi Ceru kartejo reizi atrisinat problemu (zel bet drusku apslimu un tada sajuta ka vis iet leni un tamlidzigi) !

 

Ja prieksa koda sakuma pieliek (!) noliegumu netiek izpildits neviens bet ja nonemt strada bet tad lietotas bez profila ari tad tiek klat taka butu isniegtas tiesibas ar 4 un 2 limena pieju tada luk ir mana problema :D ka Es to personigi saprotu kods ir gandriz pabeigts bet lidz galama nau savest lidz galam trukst kaut kada koda dala ka saprotu kaut kads noliegums kurs atgriez peeju neregistretam lietotajm :( !

Link to comment
Share on other sites

Janemt Pamata ideju ka visiem lietotaja limeniem dod pieeju tad var rakstit sadi un vins nelau neregistretiem pa lapu loznat piemers

if(!$_SESSION['logged_in'] or $_SESSION['u_level'] == 1 > 4)

lidz galam ta ari nevaru izdomat ka piespiest lai vins nedod pieeju citiem lietotaju pieejas limeniem un nerada koda caurumu kurs dod ari pieeju neregistretam lietotajm .

ka saprotu citas izejas var nebut ka vien rakstit funkciju kura visu parbaudis .

Edited by Faks
Link to comment
Share on other sites

toko es uzrakstiju ir vienkarsi un praktiski seit ir Bibeles Bausli Kuri Ir Jatceras vai vismaz aci jauzmet .

 

== salidzinasana - ir vienads

!= nav vienads

> lielaks

>= lielaks vai vienads

< mazaks

<= mazaks vai vienads

 

! noliegums (preteji)

or logiskais vai (apzime ar ||) - izpildas viens vai otrs vai abi

and logiskais un (apzime ar &&) - izpildaas abi

xor logiski izsledzosais vai - izpildas tikai viens no diviem

 

Ja ir velesanas te ari ir tas blogs http://faksx.sytes.net/blogs/

User lietotajs kods tads pats pieejas limenis 1

sadala 2 visu skaidri var sparast .

Edited by Faks
Link to comment
Share on other sites

if(!$_SESSION['logged_in'] || ($_SESSION['u_level'] != 4 && $_SESSION['u_level'] != 2))

if(!$_SESSION['logged_in'] or $_SESSION['u_level'] == 4 xor $_SESSION['u_level'] != 2)

respektivi lasot kodu abi ir pareizi bet tomer atdzistu ka pareizak ir ka teu pec idejas ;) bet var izmantot gan tadu gan ari tadu :)

Edited by Faks
Link to comment
Share on other sites

Paldies Par Jusu Visu Laiku Izdomaju ka to uzrakstit izradijas diezgan pratigi :D seit bus piemers !

if(!$_SESSION['logged_in'] or $_SESSION['u_level'] == 4 xor $_SESSION['u_level'] != 2)

Es laikam vel nevienu reizi neesmu redzejis biznesa produkcijasss koda tiešo xor izmantoanu.

Ja tadu atstaj bez kometara ar rupigu paskaidrojumu, var droši sist pa rokam.

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...