This will work under the following conditions:
1 - Let's find your user GUID using phpMyAdmin.
In elgg_metadata table search your admin's username, for example
column name - username
column value - admin
column entity_guid is your GUID
2 - Now you can change your password.
In elgg_metadata table search column name - password_hash for your entity_guid.
Edit value for this password_hash on:
$2y$10$jw0Kt2XUJQltETGmM6/oyuVVHMC57Q2Or/cpMqiPMQjiZJDKh18Ry
Now your password is 123456
Thanks for your reply.
Unfortunately, nothing helped.
I tried to do this:
$file = new \ElggFile();
$file->owner_guid = $user->guid;
$filename = elgg_strtolower('file/' . time() . 'file.jpg');
$file->setFilename($filename);
$file->filestore_prefix = 'file';
$file->open('write');
$file->write($content);
$file->close();
There was a typo in the previous example not $user->owner_guid but $user->guid.
But that didn't help either.
I'm using Elgg 5.1.9
As Jerome said, setting
$file->owner_guid = $user->guid;
is the reason.
Have you tried NOT setting owner_guid at all?
It also seems you're not setting container_guid in the code of your latest post. I guess you could still set
$file->container_guid = $user->guid;
to preserve the owner information after omitting to set owner_guid.
Thanks, iionly.
I tried doing this with different variations of the code.
For example, this one:
$file = new \ElggFile();
$filename = time() . 'file.txt';
$file->setFilename($filename);
$file->filestore_prefix = 'file';
$file->open('write');
$file->write('Test');
$file->close();
But the file is still saved in the logged in user's folder, but not under its own GUID
If it's just a matter of renaming, I recommend this must-have plugin.
Use the release for Elgg version you're running.
Just look for the Elgg tab in the "Recommended Releases" section when downloading the plugin.
1 - Download My plugin (Currently only available for Elgg 5, but I will release a version for Elgg 6 in a few hours.)
2 - Open \my_plugin\elgg-plugin.php and after
'bootstrap' => \MyPlugin\Bootstrap::class, // for more options
add this section:
'actions' => [
'discussion/save' => [
'access' => 'admin',
],
'file/upload' => [
'access' => 'admin',
],
],
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.