enable fastbuttons kopano-webapp for all users

Hi,

How can we enable fastbuttons in kopano webapp for all the users?

0_1523974247592_ef68447c-4bcc-4179-a0cc-ad3a80e0381e-image.png

@fbartels @Manfred

Any idea how i can do this?

Hi @ckruijntjens ,

If you want any kind of special attention I’d recommend helping others first, before screaming for attention.

Or buy a subscription and talk to our support.

@fbartels

Hi I am sorry if I push it. I want to help other people but i am Just starting with kopano! …

@ckruijntjens
Not possible in webapp itself. By default all new users should have basic shortcuts enabled.
If you want to change it for all users you can probably script it.

@marty

Hi marty Thanks for the reply. However for Evert user in webapp it is disabled bij default in my server?

Can I change this?

@marty

Hi marty Thank you!

This (untested) should write basic settings into a users’ settings:

#!/usr/bin/env python

from MAPI import *
from MAPI.Util import *
import sys

try:
    import json
except ImportError:
    import simplejson as json

def check_input():
        if len(sys.argv) < 2:
            sys.exit('Usage: %s username' % sys.argv[0])

def set_settings():
        settings = None
        data = None

        PR_EC_WEBACCESS_SETTINGS_JSON = PROP_TAG(PT_STRING8, PR_EC_BASE+0x72)

        s = OpenECSession(sys.argv[1], '', 'file:///var/run/kopano/server.sock')
        st = GetDefaultStore(s)

        try:
                settings = st.OpenProperty(PR_EC_WEBACCESS_SETTINGS_JSON, IID_IStream, 0, MAPI_MODIFY)
                data = settings.Read(33554432)
        except:
                print 'User has not used WebApp yet, no settings property exists.'

        if not data:
                data = 'No settings present.'
        else:
                j = json.loads(data)
                try:
                    j['settings']['zarafa']['v1']['main']['keycontrols'] = 'basic'
                except KeyError:
                    print "User has not logged into webapp, unable to enable keyboard shortcuts"
                    return

                new_settings = json.dumps(j)

                settings.SetSize(0)
                settings.Seek(0, STREAM_SEEK_END)
                write_settings = settings.Write(new_settings)

                if write_settings:
                    print "Enabling keyboard shortcuts for user '%s'" % sys.argv[1]
                else:
                    print "Unable to set keyboard shortcuts for user '%s'" % sys.argv[1]

if __name__ == '__main__':
        check_input()
        set_settings()

If the script is called test.py
you should be able to run it for all users with:

#!/bin/bash
if [ -z $1 ];
then
        for user in $(kopano-admin -l | tail -n+5 | awk '{print $1}');
        do
             echo Running for $user
             python test.py $user
        done
else
        for user in $(kopano-admin -l | tail -n+5 | grep $1 | awk '{print $1}');
        do
             echo Running for $user
             python test.py $user
        done
fi

Keep in mind this is untested.

Log in to reply

Looks like your connection to Kopano Community Forum was lost, please wait while we try to reconnect.