From b46cee71f79795f7300c275f2cfea7fca27a752d Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 7 Feb 2017 17:49:10 +0100 Subject: Web interface --- frontend/index.php | 229 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 frontend/index.php (limited to 'frontend/index.php') diff --git a/frontend/index.php b/frontend/index.php new file mode 100644 index 0000000..373052f --- /dev/null +++ b/frontend/index.php @@ -0,0 +1,229 @@ + + Your account has been created. + Your name is =$author->name?> and your password is =$pass?>. + Store this password in a secure place. + ' . $e->getMessage() . '.
'; + } +} + +if (isset($_POST['login'])) { + $authors = Author::search($_pdo, ['`name` like ?'], [$_POST['login_name']]); + if (count($authors) == 0) { + echo 'No such user.
'; + } else { + $author = $authors[0]; + if ($author->verifyPassword($_POST['login_pass'])) { + $_SESSION['logged_in_id'] = $author->id; + } else { + echo 'Invalid password.
'; + } + } +} + +if (isset($_SESSION['logged_in_id'])) { + $_author = new Author($_pdo, $_SESSION['logged_in_id']); + echo "You are logged in as {$_author->name}. Logout.' . $e->getMessage() . '.
'; + } + } +} +?> + +Name | +Author | +Description | +Website | +Versions | +{$pkg->name} | +" . $pkg->getAuthor()->name . " | +{$pkg->desc} | "; + + if ($pkg->url != '') + echo "Go | "; + else + echo "&endash; | "; + + echo ""; + foreach ($pkg->getVersions() as $v) + echo "{$v->major}.{$v->minor}.{$v->revision} ({$v->time_added})"; + echo " | "; + + echo + "{$pkg->name} | + "; + } + ?> +
---|
No packages found.
'; + else : + ?> +To change details, please contact the CLPM maintainer.
+Name | +URL | +Git URL | +Description | +{$pkg->name} | "; + if ($pkg->url != '') + echo "{$pkg->url} | "; + else + echo "&endash; | "; + echo " +{$pkg->git_url} | +{$pkg->desc} | + "; + } + ?> +
---|