[Owncloud] Mount fs on connect

Josu Lazkano josu.lazkano at barcelonamedia.org
Tue Sep 20 15:29:57 UTC 2011


Hello, I am new here, I just trying the ownCloud to access our files.

I am trying to mount a CIFs fs on connect and umount on logout.

Our fs is designed this way: mount.cifs //fs_server/home$/$user
$path_user -o username=$user,password=$password

I add this exec() lines on this files:

/var/www/cloud/lib/user.php

public static function logout(){
	OC_Hook::emit( "OC_User", "logout", array());
	$_SESSION['user_id'] = false;
	OC_User::unsetMagicInCookie();
	exec ("sudo umount /var/www/cloud/data/".$uid."/files/");
	return true;

/var/www/cloud/apps/user_ldap/user_ldap.php

public function checkPassword( $uid, $password ) {
	if(!$this->configured){
		return false;
	}
	$dn = $this->getDn( $uid );
	if( !$dn )
		return false;

	if (!@ldap_bind( $this->getDs(), $dn, $password ))
		return false;
	exec ("sudo mount.cifs //fs_server/home
$/".$uid." /var/www/cloud/data/".$uid."/files/ -o
username=".$uid.",password=".$password);
	return $uid;
}


We configure the LDAP access, and when some user login, the fs is
mounted and can access to the files. This part work well.

The problem is on logout, it does not umount because we need the $user
variable to umount, and on the logout() there is no any user
information.

How could I fix it?

Is there other method to add our fs to ownCloud?

Thanks for this great proyect and work.

Best regards.




More information about the Owncloud mailing list