[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
 OpenForum.dk • Vis emne - Admin password

Admin password

Spørgsmål og svar om installation af osCommerce standardpakke.
Problemer med contribution kan indlægges i Contributions.

Redaktør: Redaktionen

Admin password

Indlægaf Schellerup » 2006-08-6 21:50

Jeg vil gerne sikre min admin, så jeg har brugt følgende kode:

Quick Setup of Admin Authentication.

// Open /admin/includes/application_top.php add the following code in
// include authentication user/password of administration
require(DIR_WS_INCLUDES . 'authen.php');

// Open /admin/includes/configure.php and add the following code in
// define admin user/password
define('ADMIN_USERNAME', 'admin');
define('ADMIN_PASSWORD', 'mypasword');


// Save the following PHP codes as authen.php in /admin/includes/authen.php
<?php

if(!isset($PHP_AUTH_USER))
{ header('WWW-Authenticate: Basic realm="' . TITLE . '"');
header('HTTP/1.0 401 Unauthorized');
echo $SERVER_NAME . ' Authorization Required.';
exit;
}
else
{ if (($PHP_AUTH_USER != ADMIN_USERNAME) || ($PHP_AUTH_PW != ADMIN_PASSWORD))
{ header('WWW-Authenticate: Basic realm="' . TITLE. '"');
header('HTTP/1.0 401 Unauthorized');
echo $SERVER_NAME . ' Authorization Required.';
exit;
}
}

?>


Problemet er bare at jeg ikke kan logge på, jeg har ændret admin og mypasword teksten med det jeg vil bruge men det virker ikk. Er der andet i teksten jeg skal ændre?

Hilsen

Schellerup
Schellerup
Novice
Novice
 
Indlæg: 28
Tilmeldt: 2005-09-13 17:56
Geografisk sted: Lundby

Indlægaf benilope » 2006-08-6 22:02

Hvem er din isp

/Per
_________________
Inden du spørger i forum:
1. Hvilken OSC anvender du
2. Læs først vejledningen
3. Læs i forum om dit spørgsmål er besvaret tidligere
4. Brug søgefunktionen
_____________________
Failure is not an option
Brugeravatar
benilope
Oldtimer :o)
Oldtimer :o)
 
Indlæg: 880
Tilmeldt: 2005-08-12 20:10
Geografisk sted: Krusaa

Indlægaf Schellerup » 2006-08-6 22:14

Hej Per

B-one.

ts-elektronik.dk/admin
Schellerup
Novice
Novice
 
Indlæg: 28
Tilmeldt: 2005-09-13 17:56
Geografisk sted: Lundby

Indlægaf Michael » 2006-08-7 04:08

det scripts du hare valgt, kan ikke køre på b-one da de køre linux debrian server
Demoshop : www.The-Exterminator.dk
_________________
Knapper til din shop :
_________________
Contri jeg har været med i : http://addons.oscommerce.com/profile/94952
Brugeravatar
Michael
Ekspert medlem
Ekspert medlem
 
Indlæg: 1593
Tilmeldt: 2006-01-15 10:43
Geografisk sted: Ballerup

Indlægaf Schellerup » 2006-08-7 07:33

Hej Michael

Øv Bøv, hvad vil du så anbefale?

Og tak for oplysningen, det vil spare mig for meget tid.
Schellerup
Novice
Novice
 
Indlæg: 28
Tilmeldt: 2005-09-13 17:56
Geografisk sted: Lundby

Indlægaf ladylone » 2006-08-7 07:50

Hej Schellerup

Søg på ".htaccess", det virker på b-one.

Håber det lykkes for dig
MVH
Claus
ladylone
Oldtimer :o)
Oldtimer :o)
 
Indlæg: 851
Tilmeldt: 2006-02-25 17:24
Geografisk sted: Hillerød

Indlægaf Schellerup » 2006-08-7 08:05

Hej Claus

Det prøver jeg.
Tak for tippet.
Schellerup
Novice
Novice
 
Indlæg: 28
Tilmeldt: 2005-09-13 17:56
Geografisk sted: Lundby

Indlægaf Schellerup » 2006-08-7 19:38

Hej

Nu har jeg prøvet denne her: authorize_admin_by_htaccess_1_2.zip er det oprindelige navn jeg fandt den på - har så tilføjet _en_da men kan simpelthen ikke få den til at virke.

HJÆLP
Schellerup
Novice
Novice
 
Indlæg: 28
Tilmeldt: 2005-09-13 17:56
Geografisk sted: Lundby

Indlægaf ladylone » 2006-08-7 20:25

Hej

Prøv at søg på ".htaccess" her i forummet og læs tråden der kommer som nr. 2 (altså efter denne tråd).
Du kan nøjes med at læse om .htaccess og lade være med at installere noget modul.
Det virker for mig.

Ellers må du vende tilbage.
MVH
Claus
ladylone
Oldtimer :o)
Oldtimer :o)
 
Indlæg: 851
Tilmeldt: 2006-02-25 17:24
Geografisk sted: Hillerød

Indlægaf Schellerup » 2006-08-7 21:59

Nu har jeg lavet en htaccess og en htpasswd fil og lagt i admin.
Jeg må gøre noget galt, der kommer ikke engang en login box frem.
Jeg må da være tosset eller træt, siden jeg ikke kan få det til at virke.

Jeg ønsker mig en bog om PHP. (-:
Schellerup
Novice
Novice
 
Indlæg: 28
Tilmeldt: 2005-09-13 17:56
Geografisk sted: Lundby

Indlægaf ladylone » 2006-08-8 07:32

Hej Schellerup

1) Husker du . (punktum) foran filnavnene. Altså " .htaccess " og " .htpasswd".
2) Der skal ikke laves en "ny" .htaccess fil i admin men blot tilføjes nogle linjer i starten af den .htaccess fil som admin og standard-osc er "født" med.

Ved ikke om det bringer dig videre.

Læg evt. dine filer .ht filer her, så er det måske nemmere at finde en løsning og se, hvad der evt. er galt.
MVH
Claus
ladylone
Oldtimer :o)
Oldtimer :o)
 
Indlæg: 851
Tilmeldt: 2006-02-25 17:24
Geografisk sted: Hillerød

Indlægaf Michael » 2006-08-8 07:39

Hej Schellerup
Prøv Denne her. Den virker på min Unix server, og er meget simple.

I testside.php Tager du den øverste linje, og smider ind som den første linje i admin/index.php og den anden fil skal du skrive dit password og login og lægge filen op i rod mappen admin
Vedhæftede filer
admin.zip
(795 bytes) Downloadet 391 gange
Brugeravatar
Michael
Ekspert medlem
Ekspert medlem
 
Indlæg: 1593
Tilmeldt: 2006-01-15 10:43
Geografisk sted: Ballerup

Indlægaf Schellerup » 2006-08-8 12:24

Nu får jeg en login box frem, men kan ikke logge på.
<?php
@session_start();
if (!isset($_SESSION['loggedinadmin']) && !isset($_SERVER['PHP_AUTH_USER']) || $_SESSION['loggedinadmin'] != md5($_SERVER['PHP_AUTH_USER'])) {
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Pleeeeease.... what do you think the little promtbox did there?';
exit;
} else if (lookupCustomer($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW'])) {
$_SESSION['loggedinadmin']= md5($_SERVER['PHP_AUTH_USER']);
} else {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'You need to log in to view the requested page';
exit;
}
}

/* Lookup customer in database */
function lookupCustomer($username,$password){
$found = false;

if ($username=="Og her skal jeg skrive" && $password=="Her skal jeg skrive"){
$found=true;
}

return $found;
}



?>

Og her har jeg sat linien ind i index:<?php include('secureheader.php'); ?>

<html>
<head>
<title>Article view</title>
</head>
<body>
<h1> Denne side er beskyttet!</h1>
</body>
</html>
<?php
/*
$Id: index.php,v 1.1 2005/09/21 09:55:11 olby Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

require('includes/application_top.php');

Password skal det krypteres?

Hvad skulle man gøre uden hjælpsomme mennesker.
Schellerup
Novice
Novice
 
Indlæg: 28
Tilmeldt: 2005-09-13 17:56
Geografisk sted: Lundby

Indlægaf Schellerup » 2006-08-8 12:25

Men det virker stadig ikke.
Schellerup
Novice
Novice
 
Indlæg: 28
Tilmeldt: 2005-09-13 17:56
Geografisk sted: Lundby

Indlægaf ladylone » 2006-08-8 14:31

Hej igen

Prøv at sammenligne med følgende .htaccess

AuthName "Frit valg af tekst der vises i login boks"
AuthUserFile /customers/dit_domænenavn_hos_b_one.dk/dit_domænenavn_hos_b_one.dk/httpd.www/skal_kun_udfyldes_hvis_der_er_mapper_mellem_dit_domæne_navn_og_shopmappe/admin/.htpasswd
AuthType Basic
require valid-user

# $Id: .htaccess,v 1.1 2005/12/02 12:42:30 olby Exp $
#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
# AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)

# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers

<IfModule mod_setenvif.c>
<IfDefine SSL>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</IfDefine>
</IfModule>

# If Search Engine Friendly URLs do not work, try enabling the
# following Apache configuration parameter
#
# AcceptPathInfo On

# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)

#<IfModule mod_php4.c>
# php_value session.use_trans_sid 0
# php_value register_globals 1
#</IfModule>



Og følgende .htpasswd

test:MTuPV7ERU9gY6

Begge skal gemmes i mappen admin, og burde virke med:
Brugernavn:test
Password:1234

Til Michael:
Har ikke prøvet dit forslag, men virker det ikke kun på admin/index, så det stadig vil være muligt at indlæse de øvrige filer i admin ?

Til Schellerup:
Vend tilbage hvis du ikke får det til at virke.
MVH
Claus
ladylone
Oldtimer :o)
Oldtimer :o)
 
Indlæg: 851
Tilmeldt: 2006-02-25 17:24
Geografisk sted: Hillerød

Næste

Tilbage til Installation og konfiguration

Hvem er online

Brugere der læser dette forum: Ingen tilmeldte og 15 gæster

cron