aboutsummaryrefslogtreecommitdiffstats
path: root/util/fresh
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-12 19:43:00 -0800
committerfriendica <info@friendica.com>2013-01-12 19:43:00 -0800
commit99ff0f51a83a553051211a186d9162669636d931 (patch)
tree2a168b46a4b57139b6b65f6f28d1d8368feb4dac /util/fresh
parent434c9ae47afc4527ff58180126b5b6c43730fc50 (diff)
downloadvolse-hubzilla-99ff0f51a83a553051211a186d9162669636d931.tar.gz
volse-hubzilla-99ff0f51a83a553051211a186d9162669636d931.tar.bz2
volse-hubzilla-99ff0f51a83a553051211a186d9162669636d931.zip
Add login command to fresh
Diffstat (limited to 'util/fresh')
-rwxr-xr-xutil/fresh23
1 files changed, 23 insertions, 0 deletions
diff --git a/util/fresh b/util/fresh
index 1ab1ead5e..2cbba81cd 100755
--- a/util/fresh
+++ b/util/fresh
@@ -68,7 +68,30 @@ function process_command($line) {
}
break;
+ case 'login':
+ if(argv(1)) {
+ echo 'Password: ';
+ exec('/bin/stty -echo');
+ $x = fgets(STDIN);
+ exec('/bin/stty echo');
+ echo "\n";
+ require_once('include/auth.php');
+ $record = get_app()->account = account_verify_password(argv(1),trim($x,"\n"));
+
+ if($record) {
+ $_SESSION['account_id'] = get_app()->account['account_id'];
+ $_SESSION['last_login_date'] = datetime_convert();
+ authenticate_success($record, true, true);
+ echo 'logged in';
+ $channel = $a->get_channel();
+ if($channel)
+ echo ' as ' . $channel['channel_name'];
+ }
+ else
+ echo 'login failed.';
+ }
+ break;
default: