Use parameters
This commit is contained in:
parent
4260b94fec
commit
4762476c89
|
@ -22,12 +22,17 @@ class NoScrape extends BaseModule
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$a = DI::app();
|
||||||
|
|
||||||
$which = DI::args()->get(1);
|
if (isset($parameters['nick'])) {
|
||||||
|
// Get infos about a specific nick (public)
|
||||||
$profile = 0;
|
$which = $parameters['nick'];
|
||||||
if ((local_user()) && (DI::args()->get(2) === 'view')) {
|
$profile = 0;
|
||||||
|
} elseif (local_user() && isset($parameters['profile']) && DI::args()->get(2) == 'view') {
|
||||||
|
// view infos about a known profile (needs a login)
|
||||||
$which = $a->user['nickname'];
|
$which = $a->user['nickname'];
|
||||||
$profile = DI::args()->get(1);
|
$profile = $parameters['profile'];
|
||||||
|
} else {
|
||||||
|
System::jsonError(404, 'Invalid request');
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
Profile::load($a, $which, $profile);
|
Profile::load($a, $which, $profile);
|
||||||
|
|
Loading…
Reference in a new issue