setting sync and settings image uploading turned back on
parent
b68d4c190e
commit
179f007fab
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
use function _\find;
|
||||
|
||||
class Member
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public static function updateData(string $key, string $data)
|
||||
{
|
||||
$folks = (new Settings())->getFolks();
|
||||
$member = Session::get("member");
|
||||
$found = find($folks, ["handle" => $member["handle"]]);
|
||||
$found[$key] = $data;
|
||||
//record time updated
|
||||
$updated = new \Moment\Moment();
|
||||
$found["updated"] = $updated->format("Y-m-d\TH:i:sP");
|
||||
$newFolks = [];
|
||||
array_push($newFolks, $found);
|
||||
//save updated file
|
||||
DocTools::writeSettings("../config/folks.json", $newFolks);
|
||||
//update member data in session
|
||||
|
||||
$member = [
|
||||
"handle" => $found["handle"],
|
||||
"email" => $found["email"],
|
||||
"role" => $found["role"],
|
||||
"avatar" => $found["avi"],
|
||||
];
|
||||
Session::set("member", $member);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue