Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User from the installer lacks permissions? #3310

Open
helvete003 opened this issue Jan 27, 2020 · 2 comments
Open

User from the installer lacks permissions? #3310

helvete003 opened this issue Jan 27, 2020 · 2 comments

Comments

@helvete003
Copy link

I installed phraseanet 4.1 and 4.0.9 on an Ubuntu 18.04 machine both versions have the same issue.
The installer completes and i can login with the user that has been created during the installation.

I want to create another user so i check the docs and they say: "Admin"->"Users"->"New User"
So i go to "Admin" and see that i don't have the "Users" Page.

The reason for that seems to be that my user lacks the "canadmin" permission in basusr.
While researching the bug i saw in templates/web/admin/tree.html.twig

{% if app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::CANADMIN')) %}
  <li class="{% if feature == 'users' %}selected{% endif %}">
    <a target="right" href="{{ path('admin_users_search') }}" class="ajax zone_editusers">
      <img src="/assets/admin/images/Users.png" />
      <span>{{ 'admin::utilisateurs: utilisateurs' | trans }}</span>
    </a>
  </li>
  <li class="{% if feature == 'registrations' %}selected{% endif %}">
    <a target="right" href="{{ path('users_display_registrations') }}" class="ajax">
      <img src="/assets/admin/images/Demandes.png" />
      <span>{{ 'admin::utilisateurs: demandes en cours' | trans }}</span>
    </a>
  </li>
  {% endif %}

That my user seems to need the canadmin flag.
Looking into the basusr table i saw that my user doesn't even have an entry there so i made an insert into the table and it showed up (But fails with an error when trying to access it).

After that i tried to figure out why my user doesn't have this flags.
Looking into lib/Alchemy/Phrasea/Setup/Installer.php and following the createUser trace, i saw that the User Object never sets those flags.

I'm not sure if this is a bug or if i've made an error? I would like to know what the correct way of installing Phraseanet is since the normal documented way seems to miss some important step. (Or i am just stupid)

@moctardiouf
Copy link
Contributor

Hello,

Looking at the way you’re investigating the matter, I am sure that you’re really far from being stupid :-)

The matter you’re encountering deals with MySQL's or MariaDB's default sql_mode.
Disabling the strict mode will fix this.

Add into the my.cnf or my.ini

sql_mode=‘'

see : https://docs.phraseanet.com/4.0/en/Admin/Prerequisite.html#database

A pull request have been made by our development team adapt Phraseanet to SQL strict_mode.

Other way to test Phraseanet :

Use Docker : See details into the README of the application

User our virtualbox VM : https://www.phraseanet.com/builds/vm/vm_ovf1_vmdk_phraseanet40_rc_20170410.zip
https://www.phraseanet.com/builds/vm/ReadmePhraseanet40preview.txt

Regards

@helvete003
Copy link
Author

Hello,

thanks for the help :)
My DB was already running in NOT strict mode but i tried it again with an empty sql_mode:

mysql> SHOW VARIABLES LIKE 'sql_mode';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sql_mode      |       |
+---------------+-------+
1 row in set (0.00 sec)

But this also doesn't work.

Here are some more information about the system maybe that will help:

mysql  Ver 14.14 Distrib 5.7.28, for Linux (x86_64) using  EditLine wrapper
Server version: Apache/2.4.29 (Ubuntu)
PHP 7.2.24-0ubuntu0.18.04.1

Looking at the docs again i saw this:
Please note: PHP versions 7.1.0 or greater are not suitable at the moment.
I am currently running 7.2, could this be the problem?

Phraseanet ./setup check:system

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US:en",
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Binaries requirements :

 OK       PHP CLI is required to run Phraseanet task manager
 OK       Phraseanet requires the Unix `file` command
 OK       Exiftool is required for reading, writing and editing meta information
 OK       Exiftool version 9.15 or higher is required (10.10 provided)

Binaries recommendations :

 OK       Phraseanet recommends `file` version 5.04 or higher
 WARNING  SWFTools are required for documents (Word, Excel, PDF, etc...) support
          Please install SWFTools (http://www.swftools.org/)

 OK       Unoconv is required for documents (Word, Excel, etc...) support
 OK       Unoconv version 0.5 or higher is required (0.7 provided)
 OK       SWFTools (swfextract) are required for flash files support
 OK       SWFTools (swfextract) version 0.9.0 or higher is required (0.9.2 provided)
 OK       SWFTools (swfrender) are required for flash files support
 OK       SWFTools (swfrender) version 0.9.0 or higher is required (0.9.2 provided)
 OK       MP4Box is required for video support
 OK       MP4Box version 0.4.0 or higher is required (0.5.2 provided)
 OK       XPDF is required for PDF indexation
 OK       FFMpeg (or libav-tools) is required for Video processing
 OK       FFProbe (or avprobe) is required for Video processing

Cache Server requirements :


Cache Server recommendations :

 WARNING  A cache server extension such as Memcached, Memcache or Redis is recommended
          Install and enable a cache server extension.


Filesystem requirements :

 OK       /var/www/html/Phraseanet/config directory must be writable
 OK       /var/www/html/Phraseanet/config/stamp directory must be writable
 OK       /var/www/html/Phraseanet/config/status directory must be writable
 OK       /var/www/html/Phraseanet/config/minilogos directory must be writable
 OK       /var/www/html/Phraseanet/config/templates directory must be writable
 OK       /var/www/html/Phraseanet/config/topics directory must be writable
 OK       /var/www/html/Phraseanet/config/wm directory must be writable
 OK       /var/www/html/Phraseanet/logs directory must be writable
 OK       /var/www/html/Phraseanet/tmp directory must be writable
 OK       /var/www/html/Phraseanet/tmp/locks directory must be writable
 OK       /var/www/html/Phraseanet/tmp/caption directory must be writable
 OK       /var/www/html/Phraseanet/tmp/lazaret directory must be writable
 OK       /var/www/html/Phraseanet/tmp/download directory must be writable
 OK       /var/www/html/Phraseanet/cache directory must be writable
 OK       /var/www/html/Phraseanet/www/custom directory must be writable

Filesystem recommendations :


Locales requirements :

 OK       intl extension should be available

Locales recommendations :

 OK       intl extension should be correctly configured
 OK       intl ICU version should be at least 4+

PHP requirements :

 OK       date.timezone setting must be set
 OK       detect_unicode must be disabled in php.ini
 OK       safe_mode must be disabled in php.ini
 OK       detect_unicode must be disabled in php.ini
 OK       file_uploads must be enabled in php.ini
 OK       session.cache_limiter must be disabled in php.ini
 OK       magic_quotes_gpc must be disabled in php.ini
 OK       magic_quotes_runtime must be disabled in php.ini

PHP recommendations :

 OK       short_open_tag should be disabled in php.ini
 OK       register_globals should be disabled in php.ini
 OK       session.auto_start should be disabled in php.ini
 OK       display_errors should be disabled in php.ini
 OK       display_startup_errors should be disabled in php.ini
 OK       allow_url_fopen should be enabled in php.ini
 OK       session.hash_bits_per_character should be at least 6
 OK       session.hash_function should be enabled in php.ini
 OK       session.use_only_cookies should be enabled in php.ini
 OK       session.use_cookies should be enabled in php.ini
 OK       session.cookie_http_only should be enabled in php.ini
 WARNING  session.cookie_secure should be enabled in php.ini, but only if you use HTTPS
          Set session.cookie_secure to on in php.ini*.


System requirements :

 OK       PHP version must be at least 5.5.0 (7.2.24-0ubuntu0.18.04.1 installed)
 OK       Vendor libraries must be installed
 OK       date.timezone setting must be set
 OK       Configured default timezone "Europe/Berlin" must be supported by your installation of PHP
 OK       json_encode() must be available
 OK       session_start() must be available
 OK       ctype_alpha() must be available
 OK       token_get_all() must be available
 OK       simplexml_import_dom() must be available
 OK       detect_unicode must be disabled in php.ini
 OK       PCRE extension must be available
 OK       PHP-XML module should be installed
 OK       mb_strlen() should be available
 OK       iconv() should be available
 OK       exif extension is required
 OK       curl extension is required
 OK       gd extension is required
 OK       hash extension is required
 OK       proc_* functions are required
 OK       Socket extension is required for task manager
 OK       Zip extension is required for download
 OK       ZMQ extension is required.
 OK       utf8_decode() should be available
 OK       PDO should be installed
 OK       PDO should have MySQL driver installed (currently available: mysql)

System recommendations :

 OK       You should not use PHP 5.4.0 due to the PHP bug #61453
 OK       PCRE extension should be at least version 8.0 (8.39 installed)
 OK       pcntl extension is recommended in unix environments
 OK       Posix extension is recommended for task manager
 WARNING  Twig extension is strongly recommended in production
          Install and enable the twig extension.

 OK       Imagick or Gmagick extension is strongly recommended for image processing
 OK       Fileinfo extension is recommended
 OK       posix_isatty() should be available
 OK       ftp extension is required for FTP export
 OK       a PHP accelerator should be installed
 OK       short_open_tag should be disabled in php.ini
 OK       magic_quotes_gpc should be disabled in php.ini
 OK       register_globals should be disabled in php.ini
 OK       session.auto_start should be disabled in php.ini

I've compared my system to the VM you provided and except for the versions of the programms everything else seems to be the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants