your login script is set to create a session named directoryid, it does not create a userid session, so you will need to edit the code to use the directoryid session instead.
to add additional users to the power CMS system, it checks to make sure that the UserGroupID session variable is equal to 1
you would need to add a UserGroup column to your users table. for users that should access the CMS admin panel, set that column to 1 for users that should not, set it to 0
and edit the login behavior to set the UserGroupID session variable using the UserGroup column.