This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Using the LTB Self Service Password's functions | |
// LTB-project.org | |
$ldap_url = "ldaps://<your active directory address>"; | |
$ldap_binddn = "cn=manager,dc=example,dc=com"; | |
$ldap_bindpw = 'MyPassword'; | |
$ldap_base = "dc=example,dc=com"; | |
$ldap_filter = "(&(objectClass=user)(description=Student*)(sAMAccountName={login})(!(userAccountControl:1.2.840.113556.1.4.803:=2)))"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import subprocess | |
import csv | |
PHP_SCRIPT_DIR = 'massreset.php' | |
CSV_DIR = 'accounts.csv' | |
def get_data_from_csv(csv_file_path): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
import csv | |
import sys | |
from xlsxwriter.workbook import Workbook | |
import xlwt | |
def csv_to_excelX(csv_path): | |
workbook = Workbook(csv_path + '.xls') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once("PSSSOSettings.php"); | |
function mySSOErrorHandler($errno, $errstr, $errfile, $errline) | |
{ | |
if (!(error_reporting() & $errno)) { | |
// This error code is not included in error_reporting | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ErrorMessage = ""; //leave as blank | |
$NotificationEmail = ""; //email with details will be sent here if an error occurs | |
$FromEmail = ""; //from address of the above email | |
$PowerschoolConnectedString = "Sign Out"; //things are working fine if this string exists in cURL buffer, no need to change | |
$PowerschoolErrorString = "<title>Error</title>"; //something went wrong if this string exists in cURL buffer, no need to change | |
$PowerschoolErrorString1 = "<div class=\"feedback-alert\">There was an error processing your sign in request. Please try again. If this problem continues, contact your school directly for assistance.</div>"; | |
$PowerschoolErrorString2 = "<span class=\"error\">"; | |
$OracleListener = ""; //listener name defined in tnsnames.ora. For example: your.oracle.server.address:1521/PSPRODDB | |
$OracleUsername = ""; //factory default powerschool read only ODBC login name, no need to change |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once("PSSSOSettings.php"); | |
function SSOUpdateGuardianAccount($Username, $NewUsername, $Password, $Last, $First, $Email, $Disable, $PSUsername, $PSPassword) { | |
date_default_timezone_set('Asia/Ho_Chi_Minh'); | |
$old_error_handler = set_error_handler("mySSOErrorHandler"); | |
$ParentID = ""; | |
$LookupEmail = ""; | |
$SyncCompleted = false; | |
$ErrorMessage = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################## | |
# LDAP Authentication | |
######################################################################## | |
import ldap | |
from django_auth_ldap.config import LDAPSearch, LDAPSearchUnion | |
from django_auth_ldap.config import NestedActiveDirectoryGroupType | |
#AUTH_LDAP_START_TLS = True | |
AUTH_LDAP_GLOBAL_OPTIONS = { | |
ldap.OPT_X_TLS_REQUIRE_CERT: False, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name localhost; | |
access_log /var/log/nginx/mdl_access.log; | |
error_log /var/log/nginx/mdl_err.log; | |
location / { | |
root /var/www/moodle; | |
index index.php index.html index.htm; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Trinh Nguyen, Nov 18, 2014 | |
function EmailFormConfirmation() { | |
// name of the response sheet | |
var sheetname = "sheet1" | |
// insert a blank column at the end of the response sheet | |
// store the sent mail result | |
// add this formula to the first row of this column: | |
// =indirect("AG"&counta(A1:A)) | |
var columnnumber = 34 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findRowByValue(sheet, value) { | |
var dataRange = sheet.getDataRange(); | |
var values = dataRange.getValues(); | |
for (var i = 0; i < values.length; i++) { | |
for (var j = 0; j < values[i].length; j++) { | |
if (values[i][j] == value) { | |
//Logger.log(i); | |
return i+1; | |
} |