Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117753517
kolab.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
kolab.php
View Options
<?php
/*
* Kolab integration plugin for Roundcube webmail.
*
* @author Aleksander Machniak <machniak@apheleia-it.ch>
*
* Copyright (C) Apheleia IT AG <contact@apheleia-it.ch>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class
kolab
extends
rcube_plugin
{
private
$features
=
[
'Kolab
\A
ddresses'
,
'Kolab
\C
onfiguration'
,
'Kolab
\C
ontacts'
,
'Kolab
\D
elegation'
,
'Kolab
\H
elpdesk'
,
'Kolab
\U
sers'
,
];
/**
* Plugin initialization
*/
public
function
init
()
{
// register autoloader for included classes
spl_autoload_register
([
$this
,
'autoloader'
]);
$this
->
add_hook
(
'startup'
,
[
$this
,
'startupHook'
]);
$this
->
add_hook
(
'login_after'
,
[
$this
,
'loginAfterHook'
]);
// Load features and let them do the whole work
foreach
(
$this
->
features
as
$feature_class
)
{
$feature
=
new
$feature_class
(
$this
);
$feature
->
init
();
}
}
/**
* PHP5 autoloader routine for dynamic class loading
*/
public
function
autoloader
(
string
$classname
):
bool
{
if
(
str_starts_with
(
$classname
,
"Kolab
\\
"
))
{
$classname
=
str_replace
(
"
\\
"
,
'/'
,
$classname
);
$filepath
=
"{$this->home}/{$classname}.php"
;
if
(
is_readable
(
$filepath
))
{
include_once
$filepath
;
return
true
;
}
}
return
false
;
}
/**
* Handler for 'startup' hook
*/
public
function
startupHook
(
$args
):
array
{
// Read the plugin config, we try to not do this in init()
$this
->
load_config
();
return
$args
;
}
/**
* Handler for 'login_after' hook
*/
public
function
loginAfterHook
(
$args
):
array
{
// This is the best moment to clear the client cache
Kolab\Client
::
cacheClear
();
return
$args
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Apr 4, 5:37 AM (5 d, 3 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18791469
Default Alt Text
kolab.php (2 KB)
Attached To
Mode
rRPK roundcubemail-plugins-kolab
Attached
Detach File
Event Timeline