Get User logged password/login

Discuss about Group-Office development here

Moderator: Developers

side54723
Posts: 1
Joined: Wed Sep 30, 2009 5:45 am

Get User logged password/login

Postby side54723 » Wed Sep 30, 2009 5:56 am

Hello,

In order to create a away module with SIEVE, I need to get the Username/Password who is logged on Group-Office (in order to log the user on the IMAP server and send the sieve script to it). I didn't find it on the GO-PHPDOC

It's an emergency ^^
Thx by advance,

Jeff
mschering
Site Admin
Site Admin
Posts: 8281
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Get User logged password/login

Postby mschering » Mon Oct 05, 2009 7:32 am

The password is not stored readable. You can capture it with the login event. Read this page:

http://www.group-office.com/wiki/Event_handling
Best regards,

Merijn Schering
Intermesh
ZedBel
Posts: 8
Joined: Tue Aug 27, 2013 11:53 am

Re: Get User logged password/login

Postby ZedBel » Sun Nov 03, 2013 10:29 am

Hello! I also want this approch to login to other services which are outside of Groupoffice. can you give us a hint how to use the Event to get the password. I tried another way but end with no success. here is the appoch i have used.

Code: Select all

<?php
require_once("/usr/share/groupoffice/Group-Office.php");
require_once("/usr/share/groupoffice/classes/base/users.class.inc.php");
require_once("/usr/share/groupoffice/classes/base/config.class.inc.php");
global $GO_SECURITY,$GO_EVENTS;
$user = new GO_USERS();
$conf = new GO_CONFIG();
if (isset($GO_SECURITY->user_id) && $GO_SECURITY->user_id > 0)
{
   $test=$user->get_user($GO_SECURITY->user_id);
   require_once($conf->class_path.'cryptastic.class.inc.php');
   $c = new cryptastic();
  //$password = $c->decrypt($_COOKIE['GO_PW']);/// this throughs an error which GO_PW is not defined. 
   $password = $c->decrypt($_COOKIE['groupoffice']);
   //$psd= $c->decrypt($_COOKIE["groupoffice"]);
   print $test['username']." : ".$password; //for debug
        //print $GO_SECURITY->user_id;
//var_dump($_COOKIE);
}


mschering
Site Admin
Site Admin
Posts: 8281
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Get User logged password/login

Postby mschering » Mon Nov 04, 2013 8:20 am

Here's how the ldapauth module does it:

Code: Select all

<?php
class GO_Ldapauth_LdapauthModule extends GO_Base_Module{
	
	public static function initListeners() {		
		GO::session()->addListener('beforelogin', 'GO_Ldapauth_LdapauthModule', 'beforeLogin');
	}
	
	
	public static function beforeLogin($username, $password){
		
		GO::debug("LDAPAUTH: Active");
		
		$lh = new GO_Ldapauth_Authenticator();
		return $lh->authenticate($username, $password);
	}
	
}
Best regards,

Merijn Schering
Intermesh
ZedBel
Posts: 8
Joined: Tue Aug 27, 2013 11:53 am

Re: Get User logged password/login

Postby ZedBel » Mon Jan 13, 2014 2:24 pm

Hello! Thanks this works great!!! I have another problem hope i will get your swift feedback. How can i call a function which is written in BookmarksModule.php being in Mainpanal.js. thanks.

Who is online

Users browsing this forum: No registered users and 4 guests

cron