All Site Activity

  • iionly replied on the discussion topic How to get dbhost value in Elgg3.2?
    The backup-restore.rst seems to refer to use hardcoded values when using the exaple Perl script. I think it's not necessarily true that elgg_get_config() might no longer be capable to return dbhost (and maybe other cofig values from... view reply
  • Hermand Pessek replied on the discussion topic remove "commented on" river from activity Stream
    Hi @RvR , I still don't know how to do with my issue. Every time a user add post comment, a river is created on the activity stream. I do not want to display such river on the activity stream. I don't know how to do. Need... view reply
  • seri_ng replied on the discussion topic How to get dbhost value in Elgg3.2?
    I tried your recommendation within a function in start.php of my plugin and it threw an 'undefined function elgg_services( )'. Then I used '_elgg_config( )' function because it calls elgg_services( )->config, but it does not... view reply
  • seri_ng replied on the discussion topic How to get dbhost value in Elgg3.2?
    Thanks RvR! I am going try that and let you know if it works or not. view reply
  • RvR replied on the discussion topic How to get dbhost value in Elgg3.2?
    elgg_services()->config->dbhost(); (never tried) view reply
  • Hermand Pessek replied on the discussion topic ELGG.ERROR: Plugin settings cannot store arrays
    Thanks a lot view reply
  • seri_ng added a new discussion topic How to get dbhost value in Elgg3.2? in the group Beginning Developers
    I have a custom plugin to daily backup my database using mysqldump. In Elgg2.3.7, elgg_get_config('dbhost') returns a dbhost value. But it does not work with Elgg3.2.  Advice and suggestion please.
    • The backup-restore.rst seems to refer to use hardcoded values when using the exaple Perl script. I think it's not necessarily true that elgg_get_config() might no longer be capable to return dbhost (and maybe other cofig values from settings.php) on Elgg 3.3 on purpose.

      May I suggest you try with opening an issue about the problem in the Elgg repository at github to report that elgg_get_config() does no longer work as expected breaking backward compatibility and to ask if this was changed intentionally (and if not to fix it).

      In case it was changed intentionally one possibility to set/retrieve dbhost and other database credentials without hardcoding them could be adding plugin settings for each database variable necessary. Maybe there are other solutions possible right now already. I guess when trying to use _elgg_config() you would have to make use of the PHP keyword "use" to set the namespace and load some classes defined in Elgg core. BUT! the functions starting with an _ are NOT meant to be used within plugins. They should only be used in Elgg core code because they do not belong to the API functions that are kept backward compatible throughout the lifetime of an Elgg major version but can change at any time. So, the question remains (hopefully asked if you open an issue at github) why the API function elgg_get_config does no longer work as it probably should.

    • In Elgg 3.0 we protected some configuration values. This mainly included the database configuration.

      You can use: _elgg_services()->dbConfig->getConnectionConfig(\Elgg\Database\DbConfig::READ); to get all the information you want.

      Keep in mind since you're using an _ function (_elgg_services()) this isn't part of public API and can be broken at any time (like iionly said)

    • Thanks iionly and Jerome!

      I am glad to learn that any functions starting with _functionName are reserved for Elgg core codes.

      iionly, according to Jerome's answer, I do not think I should open the ticket regarding this issue (already answered).

      Jerome, if _functionName is for core codes, _elgg_services( ) is not a permanent solution then. I might take iionly's advice on creating plugin settings for these protected database values.

      Really appreciate all your help! @RvR, @iionly, and @Jerome

  • RvR replied on the discussion topic ELGG.ERROR: Plugin settings cannot store arrays
    1. Create a custom action where serialize() these values. or 2. Create a custom input/categories (same as input/tags but w/o output's view) and use it. view reply
  • Hermand Pessek added a new discussion topic ELGG.ERROR: Plugin settings cannot store arrays in the group Beginning Developers
    Hi Everyone, I am developing a plugin for elgg 3.3.1.  In the setting page of the plugin, I have the following input field. echo elgg_view_field([ '#type' => 'fieldset', 'legend' =>...
  • Hermand Pessek replied on the discussion topic Some troubles with setProfileData
    Thanks a lot. view reply
  • corey replied on the discussion topic Installing composer
    Nevermind on this, I finally gave up on it. view reply
  • trgolden replied on the discussion topic Is there a way to make some users moderators?
    iionly!  Thank you!  Those two plugins did the trick.  It's a simple admin task to turn users into moderators who then have editing/deleting ability with published posts.  Exactly what I was looking for.  I wish there... view reply
  • Thanks iionly, I'm played around with the RewriteCond and this seems to have sorted it out. I will need to watch it for while to see if has any knock effect to other plugins. The first line covers my homepage where there are some... view reply
  • Jerome Bakker replied on the discussion topic Some troubles with setProfileData
    Use Elgg developer tools plugin to check that the user's metadata are saved correctly. Access protected profile data is stored in annotations (since Elgg 3.0 I believe). For BC reasons it's also stored in metadata. So if you save it... view reply
  • corey added a new discussion topic Installing composer in the group Beginning Developers
    I have tried the path to install composer, but it isn't working out, my only thought is what steps are missing in the documentation.
  • The only important point is that you don't set write permission for the files/folders of the install folder of Elgg and its subfolders. The only exception might be during the installation where it would be necessary temporarily to allow for the... view reply
  • well I can use the following which does stop access to these extensions, but i'm still a little uneasy about anyone having access to directories like .../elgg-config/   .htaccess <FilesMatch "\.(rst|MD|txt)$">... view reply
  • some additions.... apache2.conf <Directory /var/www/html/xxxxxxx/>                 Options FollowSymLinks                 AllowOverride All    ... view reply
  • Could someone please guide me with some basic security settings. I have installed a test website using version 2.3.13 on Apache2/php55, and it's working fine, but I don't understand why I can access all the files in my Elgg directories from...
    • well I can use the following which does stop access to these extensions, but i'm still a little uneasy about anyone having access to directories like

      .../elgg-config/

       

      .htaccess

      <FilesMatch "\.(rst|MD|txt)$"> #deny these from url access
       Require all denied
      </FilesMatch>

       

      thanks

    • The only important point is that you don't set write permission for the files/folders of the install folder of Elgg and its subfolders. The only exception might be during the installation where it would be necessary temporarily to allow for the Elgg installer creating settings.php and .htaccess. Afterwards the write permission should no longer be necessary at all as the webserver would only have to read the files and read/access the folders but not write into them.

      The files you are so worried about are freely downloadable here from the site (within the zip archive) and everyone can view them also at the Elgg github repository. There's no secret in them so no harm in anyone seeing their content (which would still require knowing the full path).

    • Thanks iionly,

      I'm played around with the RewriteCond and this seems to have sorted it out. I will need to watch it for while to see if has any knock effect to other plugins. The first line covers my homepage where there are some direct links to jpg,css files etc etc, then everything else is forced through the Elgg route.

       

      RewriteCond %{REQUEST_URI} !^/mod/homepage_elgg/(.*)$
      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} !-f
      #RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?__elgg_uri=$1 [L,QSA]

       

  • Hermand Pessek replied on the discussion topic Some troubles with setProfileData
    Thanks I will check. view reply