Comments (3)
There might have been some performances differences in the past, but now that the preferences are all retrieved once, there should not be much difference.
I think you are correct. The code would be much clearer if it simply used
!userGedcomAdmin(WT_USER_ID, $gedcom_id)
If you have time to update this.... ;-)
from webtrees.
Hello, and sorry I did not reply earlier, I was away for few days.
I can update it indeed, as it would bring a lot more clarity to the code.
The only point to keep in mind (as commented in #129) is that there is the case where the user is not explicitly an admin of the gedcom for which the method userGedcomAdmin
needs to check whether it is a global administrator or not. To do so, it needs a call to the DB (as there is no cache for users' global preferences). In the current logic, the method is called only in the case where $ged_id!=WT_GED_ID
, but if we simplify it, it would be called in all cases, so would bring a slight performance hit for users who are global admin without being the current gedcom admin.
Let me know your thoughts about it.
I can as well in parallel try to work on a improvement on users' global preferences, the same way you did for Gedcom/Tree, with maybe the introduction of a WT_User
class.
Jonathan
from webtrees.
I have created an initial WT_User class.
I need to test this with various versions of PHP
from webtrees.
Related Issues (20)
- Error after used "date phrase" HOT 5
- CKEditor strips some bootstrap classes HOT 3
- The Last e-mail reminder date in Pending Changes is reported as one day ahead of actual HOT 1
- Reports for family or inividual, pdf view: missing watermark HOT 1
- Reports Descendants without result HOT 7
- Error in the order that custom module functions are called HOT 2
- Error in Statistics module for families and other HOT 1
- Missing module causes site to be unreachable HOT 3
- Username Not Passed to Login Page HOT 1
- Missing translation
- Place Hierarchy Links Broken After Gedcom Import HOT 2
- Update place names - missing places HOT 4
- Support .well-known/change-password
- untranslated string vendor.min.js HOT 8
- Datatables v2 breaks table layouts HOT 6
- Fixes: #4948 - Update ckeditor-js.phtml extraAllowedContent (#4949) in 2.1.19? HOT 1
- Use base_url in webmanifest.json
- Import of location data not working HOT 13
- Error in Statistics module for others still present HOT 2
- Error after merging two persons with postgres HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webtrees.