Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Framasoft
myframa
Commits
5680bd3d
Commit
5680bd3d
authored
Sep 23, 2016
by
JosephK
Browse files
[recovery] mail url
parent
d99f86f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
index.php
View file @
5680bd3d
<?php
// remplacer http par https
define
(
'URL_BASE'
,
str_replace
(
$_SERVER
[
'DOCUMENT_ROOT'
],
isset
(
$_SERVER
[
'HTTPS'
])
?
'https'
:
'http'
)
.
'://'
.
$_SERVER
[
'HTTP_HOST'
],
dirname
(
$_SERVER
[
'SCRIPT_FILENAME'
])
);
define
(
'URL_BASE'
,
(
isset
(
$_SERVER
[
'HTTPS'
])
?
'https'
:
'http'
)
.
'://'
.
$_SERVER
[
'HTTP_HOST'
]
.
str_replace
(
$_SERVER
[
'DOCUMENT_ROOT'
],
''
,
dirname
(
$_SERVER
[
'SCRIPT_FILENAME'
])
)
);
define
(
'TITLE'
,
'MyFrama'
);
/**
...
...
shaarli/plugins/recovery/recovery.php
View file @
5680bd3d
<?php
$ShaarliRoot
=
dirname
(
dirname
(
dirname
(
$_SERVER
[
'SCRIPT_FILENAME'
])));
$ShaarliURL
=
(
isset
(
$_SERVER
[
'HTTPS'
])
?
'https'
:
'http'
)
.
'://'
.
$_SERVER
[
'HTTP_HOST'
]
.
dirname
(
strtok
(
$_SERVER
[
'REQUEST_URI'
],
'?'
));
// I18n
if
(
!
in_array
(
'i18n'
,
$GLOBALS
[
'config'
][
'ENABLED_PLUGINS'
])
&&
!
function_exists
(
t
))
{
function
t
(
$txt
)
{
return
$txt
;
}
...
...
@@ -15,7 +14,10 @@ function hook_recovery_render_header($data)
if
(
isset
(
$_GET
[
'recover'
]))
{
/* Step 1 : check email */
if
(
isset
(
$_POST
[
'email'
])
&&
isset
(
$_POST
[
'token'
])
&&
tokenOk
(
$_POST
[
'token'
])
)
{
unset
(
$_SESSION
[
'tokens'
][
$_POST
[
'token'
]]);
$ShaarliURL
=
(
isset
(
$_SERVER
[
'HTTPS'
])
?
'https'
:
'http'
)
.
'://'
.
$_SERVER
[
'HTTP_HOST'
]
.
dirname
(
strtok
(
$_SERVER
[
'REQUEST_URI'
],
'?'
));
$c
=
$GLOBALS
;
if
(
$GLOBALS
[
'config'
][
'RECOVERY'
][
'attempt'
]
>=
10
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment