Automatic login with ownCloud credentials

This commit is contained in:
Martin Porcheron 2014-08-09 21:46:23 +01:00
parent 86f282f885
commit 2f52f826bd
21 changed files with 259 additions and 152 deletions

View file

@ -9,9 +9,19 @@
* https://github.com/RainLoop/owncloud
*/
OC::$CLASSPATH['OC_RainLoop_Helper'] = OC_App::getAppPath('rainloop') . '/lib/RainLoopHelper.php';
OCP\App::registerAdmin('rainloop', 'admin');
OCP\App::registerPersonal('rainloop', 'personal');
$bAutologin = OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false);
if ('on' === $bAutologin)
{
OCP\Util::connectHook('OC_User', 'post_login', 'OC_RainLoop_Helper', 'login');
OCP\Util::connectHook('OC_User', 'logout', 'OC_RainLoop_Helper', 'logout');
OCP\Util::connectHook('OC_User', 'post_setPassword', 'OC_RainLoop_Helper', 'changePassword');
}
OCP\Util::addScript('rainloop', 'rainloop');
OCP\App::addNavigationEntry(array(
@ -19,5 +29,5 @@ OCP\App::addNavigationEntry(array(
'order' => 10,
'href' => OCP\Util::linkTo('rainloop', 'index.php'),
'icon' => OCP\Util::imagePath('rainloop', 'mail.png'),
'name' => 'RainLoop'
'name' => 'Email'
));