Thank you for these examples.
I created the file /var/www/fog/lib/hooks/mobileusernologin.hook.php and pasted your first code, then changed the userLogginIn function with your 2 other codes (and replacing “username1” by “fog”), but I didn’t see any difference in each case: when logging to http://…/fog/management/index.php whith either “fog” account or a “test” account, I still see all the menus.
What am I doing wrong ?
Posts made by Fred53
-
RE: Mobile interface unavailable
-
RE: Mobile interface unavailable
I understood that hooks are like plugins which can be added and activated with “public $active = true;” inside the php file.
I search for USER_TYPE in the sources files and only find them in these files :
/lib/plugins/ldap/hooks/ldappluginhook.hook.phpself::$HookManager ->register( 'USER_LOGGING_IN', array( $this, 'checkAddUser' ) ) ->register( 'USER_TYPE_HOOK', array( $this, 'setLdapType' ) ) ->register( 'USER_TYPES_FILTER', array( $this, 'setTypeFilter' ) ) ->register( 'USER_TYPE_VALID', array( $this, 'isLdapType' ) );
/lib/fog/user.class.php
$type = $tmpUser->get('type'); self::$HookManager ->processEvent( 'USER_TYPE_HOOK', array( 'type' => &$type ) ); self::$HookManager ->processEvent( 'USER_TYPE_VALID', array( 'type' => &$type, 'typeIsValid' => &$typeIsValid ) ); if ($typeIsValid && !in_array($type, array(0, 1))) { $typeIsValid = false; }
if (self::$FOGUser->isValid()) { $type = self::$FOGUser->get('type'); self::$HookManager ->processEvent( 'USER_TYPE_HOOK', array('type' => &$type) ); $this ->set('id', self::$FOGUser->get('id')) ->set('name', self::$FOGUser->get('name')) ->set('password', '', true) ->set('type', $type); if (!$this->_sessionID) { $this->_sessionID = session_id(); }
/lib/pages/processlogin.class.php
$type = self::$FOGUser->get('type'); self::$HookManager ->processEvent( 'USER_TYPE_HOOK', array('type' => &$type) );
But I don’t really understand what this code do and what is the link with my aim (having a restricted web interface for a specific user).
The only lead I see is in the first file which talks about an unprivileged user account (with type=“991”)
$access = $ldap->authLDAP($user, $pass); unset($ldap); switch ($access) { case 2: // This is an admin account, break the loop $tmpUser ->set('name', $user) ->set('password', $pass) ->set('type', 990) ->save(); break 2; case 1: // This is an unprivileged user account. $tmpUser ->set('name', $user) ->set('password', $pass) ->set('type', 991) ->save(); break; default:
Is type “991” the key ? or does it only concern ldap ?
-
RE: Mobile interface unavailable
I don’t know what hooks are and where I can find USER_TYPE_HOOK and USER_TYPE_VALID.
Is it in the database ? (I only found a field named Type in the Users table which is equal to 0). -
RE: Mobile interface unavailable
Ok, so I can’t let teachers restore an image without giving them all access to the web interface. It’s a shame.
-
Mobile interface unavailable
Hello,
I just installed the latest version of Fog and I can’t access to …/fog/mobile.
Does the Mobile Interface still exist ?
Regards -
RE: PXE-T01: File not found
@george1421 I’m using dnsmasq 2.76.
I just tried your ltsp.conf file and it works.
Thank you very much. -
PXE-T01: File not found
Hello,
I did a fresh install of Debian 9 following this page : https://wiki.fogproject.org/wiki/index.php?title=Debian_8
Then I followed Install dnsmasq on CentOS 7 (https://wiki.fogproject.org/wiki/index.php?title=ProxyDHCP_with_dnsmasq) as my DHCP server is a home internet box.During FOG setup, I didn’t choose any DHCP/DNS option (seen here : https://wiki.fogproject.org/wiki/index.php?title=Using_FOG_with_an_unmodifiable_DHCP_server/_Using_FOG_with_no_DHCP_server).
Now when I boot a PC client, DHCP works (IP found) but it doesn’t boot (PXE-T01: File not found, PXE-E3B : TFTP Error - File Not found)
/etc/dnsmasq.d/ltsp.conf contains this : https://framabin.org/?98496140ffa228a1#FNmhScXt0cwbQm8ya2SY2AYRhjcRdlTRX4zksG3drwI=
/tftpboot contains this : https://framabin.org/?cf5d1f8abaff3b10#dUhgKqKg8r/Opl32tHKEgTyev40sIdhUlWTgoHC0qGs=
PC and FOG server are Lenovo ThinkCentre M79Have you got an idea of what is wrong ?