Giter Site home page Giter Site logo

cupertinobr / roundcube-gravatar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prodrigestivill/roundcube-gravatar

0.0 0.0 0.0 31 KB

Roundcube plugin to show gravatar profile image or any custom API

Home Page: https://packagist.org/packages/prodrigestivill/gravatar

License: GNU General Public License v3.0

PHP 100.00%

roundcube-gravatar's Introduction

Roundcube Gravatar

Non official plug-in showing Gravatar profile images inside the Roundcube webmail client, it also supports custom avatars API.

It has been implemented as Roundcube readonly hidden addressbook. You have to ensure this plugin is added into the latest entry in the main config ($config['plugins']). If so and any address book (LDAP, Google, etc...) already has a photo for a contact it will use first the other pictures and lastly if none reported it will use gravatar (Roundcube will use it in following the order listed in the main config).

Tested in roundcube 1.2.0.

Installation

Intallation steps:

  • Via composer:
    • Run php composer.phar require "prodrigestivill/gravatar":"dev-master"
  • Via git:
    • Clone the repository: cd roundcube/plugins && git clone [email protected]:prodrigestivill/roundcube-gravatar.git gravatar
  • Via tarball:
    • Download and extract the tarball into roundcube/plugins directory and rename the extracted directory to gravatar

For the expected behaviour ensure it is always the latest plugin (or at least addressbook plugin) in the $config['plugins'] list at config/config.inc.php.

To enable per user: Login to Roundcube and enable/disable plugin by navigating to the Settings page, clicking on Preferences, click on Address Book, and Enable Gravatar, and Save.

To configure/change default values:

  • Copy config.inc.php.dist to config.inc.php in plugins/gravatar/ directory.
  • Modify the values you are interested into change and comment the rest with '//'

Custom API

You can define your custom API for photos at 'gravatar_custom_photo_api' in config.inc.php in plugins/gravatar/ directory. With the following substitutions.

  • %%: literal '%'
  • %s: schema ('http', 'https') depending of 'gravatar_https' config
  • %e: contact email (escaped with urlencode)
  • %m: hashed md5(email)
  • %a: hashed sha1(email)
  • %z: configured avatar size (in px)
  • %r: configured rating ('g', 'pg', 'r', 'x')

Usage for default Gravatar API is: %s://www.gravatar.com/avatar/%m?s=%z&r=%r&d=404

You can use local files, it is not needed to be an URL. But if you plan to use it for direct filesystem access, for security reasons it is best to only use hashed email substitutions, even that all parameters are escaped with urlencode.

Examples:

$config['gravatar_custom_photo_api'] = 'http://www.example.com/directory/%e.jpg?s=%z';
//OR//
$config['gravatar_custom_photo_api'] = '/path/%m.jpg';

roundcube-gravatar's People

Contributors

prodrigestivill avatar adam-runcode-pl avatar maltekiefer avatar nicrame avatar cupertinobr avatar 532910 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.