# Teacher site Directory Authentication using mod_auth_mysql apache
# module. (apt-get install libapache2-mod-auth-mysql if not installed)
# Paste this into the directory section of the teacher site, replace
# existing values there.

  <Directory /opt/openadmin/SCHOOLNAME/tadmin>

    Options +Includes 

    AuthType Basic
    AuthName Teacher

    # AuthUserFile /etc/apache2/auth_users/SCHOOLNAMEteacher
    # Old Authorization File

    AuthUserFile /dev/null
    AuthBasicAuthoritative off

    AuthMYSQL on
    AuthMySQL_Authoritative on

    AuthMySQL_DB mysqlDATABASE
    AuthMySQL_Host localhost
    AuthMySQL_User mysqlUSER
    AuthMySQL_Password mysqlPASSWORD

    AuthMySQL_Password_Table staff
    AuthMySQL_Username_Field userid
    AuthMySQL_Password_Field password

    AuthMySQL_Empty_Passwords off
    AuthMySQL_Encryption_Types Plaintext


    <Limit GET POST> 
       require valid-user
    </Limit>
   </Directory>

  <Directory /opt/openadmin/SCHOOLNAME/tcgi>

    AuthType Basic
    AuthName Teacher

    # AuthUserFile /etc/apache2/auth_users/SCHOOLNAMEteacher
    # Old Authorization File

    AuthUserFile /dev/null
    AuthBasicAuthoritative off

    AuthMYSQL on
    AuthMySQL_Authoritative on

    AuthMySQL_DB mysqlDATABASE
    AuthMySQL_Host localhost
    AuthMySQL_User mysqlUSER
    AuthMySQL_Password mysqlPASSWORD

    AuthMySQL_Password_Table staff
    AuthMySQL_Username_Field userid
    AuthMySQL_Password_Field password

    AuthMySQL_Empty_Passwords off
    AuthMySQL_Encryption_Types Plaintext

    <Limit GET POST> 
       require valid-user
    </Limit>

   </Directory>
