Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

secure admin problem


ukkoc

Recommended Posts

I have put to .../admin/index.php this code to secure admin site.

 

<?php

 

// Kullanici Listesi

 

$kul[0]['username']="xxxxx";

$kul[0]['password']="xxxxxx";

 

$kul[1]['username']="xxxxx";

$kul[1]['password']="2xxxxx";

 

 

// Dogrulama

 

function authenticate()

{

header( 'WWW-Authenticate: Basic realm="Private"' );

header( 'HTTP/1.0 401 Unauthorized' );

echo 'Authorization Required.';

exit;

}

 

if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) { authenticate(); } else

{

for($i=0;$i<count($kul);$i++) { if($_SERVER['PHP_AUTH_USER']==$kul[$i]['username'] && $_SERVER['PHP_AUTH_PW']==$kul[$i]['password']){$auth=TRUE;}}

if($auth !=TRUE) {authenticate();}

}

?>

 

it works. but I recieved this message top of the page.

 

what can I do?

Link to comment
Share on other sites

I have put to .../admin/index.php this code to secure admin site.

 

<?php

 

// Kullanici Listesi

 

$kul[0]['username']="xxxxx";

$kul[0]['password']="xxxxxx";

 

$kul[1]['username']="xxxxx";

$kul[1]['password']="2xxxxx";

// Dogrulama

 

function authenticate()

{

header( 'WWW-Authenticate: Basic realm="Private"' );

header( 'HTTP/1.0 401 Unauthorized' );

echo 'Authorization Required.';

exit;

}

 

if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) { authenticate(); } else

{

for($i=0;$i<count($kul);$i++) { if($_SERVER['PHP_AUTH_USER']==$kul[$i]['username'] && $_SERVER['PHP_AUTH_PW']==$kul[$i]['password']){$auth=TRUE;}}

if($auth !=TRUE) {authenticate();}

}

?>

 

it works. but I recieved this message top of the page.

 

what can I do?

 

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /data/web/virtuals/magazadan.com/www/admin/index.php:37) in /data/web/virtuals/magazadan.com/www/admin/includes/functions/sessions.php on line 67

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /data/web/virtuals/magazadan.com/www/admin/index.php:37) in /data/web/virtuals/magazadan.com/www/admin/includes/functions/sessions.php on line 67

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...