#!/usr/bin/perl
# Copyright 2001-2021 Leslie Richardson
# This file is part of Open Admin for Schools.
# Open Admin for Schools is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
%lex = ('Edit' => 'Edit',
'Staff Member' => 'Staff Member',
'Main' => 'Main',
'Eoy' => 'Eoy',
'Contact' => 'Contact',
'Update' => 'Update',
'Error' => 'Error',
'Password' => 'Password',
'You MUST have a unique userid and a password' =>
'You MUST have a unique userid and a password',
'Grades' => 'Grades',
'Homeroom(s)' => 'Homeroom(s)',
'Position' => 'Position',
'Record Added/Updated' => 'Record Added/Updated',
'Separate with Spaces' => 'Separate with Spaces',
'Add' => 'Add',
'Required' => 'Required',
'Bold' => 'Bold',
'Preregistration' => 'Preregistration',
'Access Control(s)' => 'Access Control(s)',
'Current' => 'Current',
'Spaces Not Allowed' => 'Spaces Not Allowed',
'Type' => 'Type',
'Percent' => 'Percent',
'Occupation' => 'Occupation',
'Userid Already Exists' => 'Userid Already Exists',
'Staff' => 'Staff',
'Save' => 'Save',
);
my $self = 'staffEditSecondary.pl';
use CGI;
use DBI;
use Data::Password qw(:all); # for password checking...
use Crypt::GeneratePassword qw(:all); # password generation.
# First Nations settings.
my $maxmulti = 4; # Occupation Limits for INAC First Nations occupations.
my $template = 'staff.tpl';
my $fnmode; # set below configuration load.
# Password config; rest in admin.conf
# For Generation
$g_staffpwd_minfreq = .001;
$g_staffpwd_avgfreq = .001;
$g_staffpwd_lang = 'en'; # only en or de available.
# For Checking
my $g_staffpwd_groups = 0; # turn off character group (uppercase, lowercase, symbols) checking
my $g_staffpwd_following = 0; # turn off following character checking (keyboard, same)
# WATCH: Only loading userids and passwords here!
eval require "../../etc/admin.conf.root";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@\n";
}
my $q = new CGI;
print $q->header(-charset, $charset );
my %arr = $q->Vars;
my $recid = $arr{id};
my $dbtype = 'mysql';
my $dsn = "DBI:$dbtype:dbname=$dbase";
my $dbh = DBI->connect($dsn,$user,$password);
$dbh->{mysql_enable_utf8} = 1;
# Load Configuration Variables;
my $sth = $dbh->prepare("select id, datavalue from conf_system where filename = 'admin'");
$sth->execute;
if ( $DBI::errstr ) { print $DBI::errstr; die $DBI::errstr; }
while ( my ($id, $datavalue) = $sth->fetchrow ) {
eval $datavalue;
if ( $@ ) {
print "$lex{Error}: $@
\n";
die "$lex{Error}: $@\n";
}
}
# Print Page Header
my $title = qq{$lex{Add}/$lex{Edit} Secondary Users};
print qq{$doctype\n