EdgarsK Posted July 24, 2009 Report Share Posted July 24, 2009 Sveiki mans kods <?php $userlist=array( md5('kein=parole01'), md5('foxc=parole01') ); if(!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); echo "[security] - Pieeja liegta / ".$this->configs[main][site_title].' administrācija.'; exit; }else{ $user=$_SERVER['PHP_AUTH_USER']; $pass=$_SERVER['PHP_AUTH_PW']; $integer=md5($user.'='.$pass); if(in_array($integer,$userlist)) { unset($integer); }else{ unset($_SERVER['PHP_AUTH_USER']); unset($_SERVER['PHP_AUTH_PW']); header("Location: ".$this->configs[main][site_http]."/op"); } } ?> Kļūda: Lapa netiek korekti pāradresēta kā lai pareizi pāradresēju? Quote Link to comment Share on other sites More sharing options...
ohmygod Posted July 24, 2009 Report Share Posted July 24, 2009 Kā izpaužas nekorektā pāradresācija? Nenotiek vispār vai veras kkas nepareizs vaļā? Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted July 24, 2009 Report Share Posted July 24, 2009 Ieslēdz error reportingu un display errors un aizkomentē pagaidām to header(), jo header() nenostrādā tad, ja kaut kas kaut kur sākas datu (kļūdu paziņojumu, piemēram) izvade. Quote Link to comment Share on other sites More sharing options...
EdgarsK Posted July 24, 2009 Author Report Share Posted July 24, 2009 (edited) bet teiksim ja ievadu nepareizi viss nostrada, ja ievadu pareizi nonakam lidz sim Edited July 24, 2009 by EdgarsA Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted July 24, 2009 Report Share Posted July 24, 2009 Spriežot pēc koda, ja ir ievadīta pareiza parole, tad nekādai pāradresēšanai nebūtu jānotiek, vai ne? Varbūt, ka Tu includē viņu kaut kur, kas tālāk atkal pāradresē un tā veidas bezgalīgs pāradresēšanas cikls? Quote Link to comment Share on other sites More sharing options...
marcis Posted July 24, 2009 Report Share Posted July 24, 2009 $_SERVER['PHP_AUTH_USER'] un $_SERVER['PHP_AUTH_PW'] mainīgos nevar unset'ot. Tas nozīmē, ka līdz ko tu ievadi nepareizu lietotājvārdu un/vai paroli tu iekļūsti redirect ciklā :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.