Both sides previous revision Previous revision Next revision | Previous revision |
en:entwickler:changes_to_functions_and_methods [2021/09/21 20:56] – fasse | en:entwickler:changes_to_functions_and_methods [2022/04/15 20:11] (current) – fasse |
---|
| |
With this page we want to help plugin developers to stay compatible with the changes that were made in the Admidio core and that could affect plugins. During the development of Admidio we try to not change our existing methods and functions but sometimes it's necessary and could break your working plugin. Here you will find a list of methods and functions that we changed in a specific Admidio version with a notice how you could fix this in your plugin if you have used that method or function. | With this page we want to help plugin developers to stay compatible with the changes that were made in the Admidio core and that could affect plugins. During the development of Admidio we try to not change our existing methods and functions but sometimes it's necessary and could break your working plugin. Here you will find a list of methods and functions that we changed in a specific Admidio version with a notice how you could fix this in your plugin if you have used that method or function. |
| |
| ===== Admidio version 4.2 ===== |
| |
| === Changes/Deprecations === |
| == Class == |
| * **Menu** renamed to **MainMenu** |
| == Class methods == |
| * **HtmlPage->hasNavbar()** was removed |
| * **Email->adminNotification()**: 'Email->sendNotification()' |
| * **Email->addBlindCopy()**: 'Email->addRecipient()' |
| |
===== Admidio version 4.1 ===== | ===== Admidio version 4.1 ===== |
To prevend CSRF attacks as described in [[https://github.com/Admidio/admidio/issues/612|Issue 612]] we have introduce the UUID for the user and role objects. To call Admidio scripts that use the an id or as parameter you must now use the UUID. Therefore tables like **adm_users** and **adm_roles** got new columns **usr_uuid** and **rol_uuid** where you can get the uuid of the object instead of the **usr_id** or **rol_id**. So if you want to call the profile of a user you do it until now with the following url: <code php>ADMIDIO_URL. FOLDER_MODULES. '/profile/profile.php?usr_id=4711'</code> Now you must use the url with the following parameter <code php>ADMIDIO_URL. FOLDER_MODULES. '/profile/profile.php?user_uuid=bfa4db69-1722-4704-801f-e8b4bfe2f081'</code> We add a new method to the **TableAccess** class to read a record with the UUID. <code php>$user = new User($gDb); | To prevend CSRF attacks as described in [[https://github.com/Admidio/admidio/issues/612|Issue 612]] we have introduce the UUID for the user and role objects. To call Admidio scripts that use the an id or as parameter you must now use the UUID. Therefore tables like **adm_users** and **adm_roles** got new columns **usr_uuid** and **rol_uuid** where you can get the uuid of the object instead of the **usr_id** or **rol_id**. So if you want to call the profile of a user you do it until now with the following url: <code php>ADMIDIO_URL. FOLDER_MODULES. '/profile/profile.php?usr_id=4711'</code> Now you must use the url with the following parameter <code php>ADMIDIO_URL. FOLDER_MODULES. '/profile/profile.php?user_uuid=bfa4db69-1722-4704-801f-e8b4bfe2f081'</code> We add a new method to the **TableAccess** class to read a record with the UUID. <code php>$user = new User($gDb); |
$user->readDataByUuid($userUuid);</code> This Method could be used with all tables that have a **uuid** column. If you save a new record the **uuid** column will be filled automatically. You must do nothing and got a record with a uuid. | $user->readDataByUuid($userUuid);</code> This Method could be used with all tables that have a **uuid** column. If you save a new record the **uuid** column will be filled automatically. You must do nothing and got a record with a uuid. |
| |
| === Call Admidio scripts with the UUID for user or role === |
| The following methods are removed:\\ |
| **Session::renewMenuObject()**\\ |
| **Session::renewOrganizationObject**\\ |
| **Session::renewUserObject(int $userId = 0)**\\ |
| New methods that could be used instead of them:\\ |
| **Session::reloadAllSessions()**\\ |
| **Session::reloadSession(int $userId)**\\ |
| |
| |