Skip to content

Instantly share code, notes, and snippets.

View mtszpater's full-sized avatar
🙃
nothing

Mateusz Pater mtszpater

🙃
nothing
View GitHub Profile
public function registerUser($userLogin, $userPassword) {
if ($this->database->isLoginBusy($userLogin)) {
return false;
}
if ($this->database->registerUser($userLogin, $userPassword)) {
return true;
}
return false;
}
private function user() {
if (!$this->userService->isAdmin()) {
$this->status = StatusHandler::error(StatusHandler::NOT_ADMIN);
return;
}
if ($this->userService->registerUser($this->args['newlogin'], $this->args['newpassword'])) {
$this->status = StatusHandler::success();
}
else {
sum=0
count=0
while [ -n "$1" ]; do
((count++))
sum=`expr $sum + $1`
shift
done
expr $sum / $count
{"status":"OK"}
{"status":"OK"}
{"status":"OK"}
{"status":"OK"}
{"status":"OK"}
{"status":"OK"}
{"status":"OK"}
{"status":"OK"}
{"status":"OK"}
{"status":"OK"}
{ "open": { "baza": "springbootdb", "login": "ja", "password": ""}}
{"organizer": {"secret": "d8578edf8458ce06fbc5bb76a58c5ca4", "newlogin": "Donald_Grump11", "newpassword": "admin"}}
{"organizer": {"secret": "d8578edf8458ce06fbc5bb76a58c5ca4", "newlogin": "Sanka", "newpassword": "haslo"}}
{"organizer": {"secret": "d8578edf8458ce06fbc5bb76a58c5ca4", "newlogin": "Ogi", "newpassword": "hejper"}}
{"event": {"login": "Donald_Grump11", "password": "admin", "eventname": "Konwent", "start_timestamp": "2016-01-20 10:00", "end_timestamp": "2016-02-01 18:00"}}
{"event": {"login": "Sanka", "password": "haslo", "eventname": "PG", "start_timestamp": "2017-01-02 8:00", "end_timestamp": "2017-02-02 18:00"}}
{"event": {"login": "Ogi", "password": "hejper", "eventname": "KASIA", "start_timestamp": "2017-03-12 11:00", "end_timestamp": "2017-03-15 21:00"}}
{ "user": { "login": "Donald_Grump11", "password": "admin", "newlogin": "Delores65", "newpassword": "commodo007"} }
{ "user": { "login": "Sanka", "password": "haslo", "newlog