This file contains 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
def create | |
ldap_user = ActiveDirectoryUser.authenticate(params[:username], params[:password]) | |
user = User.find_by_provider_and_uid("ldap",params[:username]) || User.create_with_omniauth("ldap",params[:username]) | |
user.name = ldap_user.name | |
user.groups = ldap_user.groups.join(",") | |
user.save | |
if LDAP_AllowedGroups != (LDAP_AllowedGroups - user.groups.split(",")) then | |
session[:user_id] = user.id | |
redirect_to "/pages/splash" | |
else |
This file contains 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 = '10.0.0.1' # Active Directory server name or IP | |
PORT = 389 # Active Directory server port (default 389) | |
BASE = 'DC=arcath,DC=local' # Base to search from | |
DOMAIN = 'arcath.local' # For simplified user@domain format login |
This file contains 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
' Printer Script based on AD OU | |
' Written by Adam Laycock (Arcath) | |
' July 2009 | |
' Updated December 2011 | |
' Variables | |
Set WshNetwork = WScript.CreateObject("WScript.Network") ' Network Object | |
Set oPrinters = WshNetwork.EnumPrinterConnections ' Printers Sub Object | |
printServer = "printserver" ' Hostname of your Print Server (add more if you have multiple print servers |
This file contains 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
' Very Basic Seasonal greeter for BGInfo | |
' Add a case for each month, and then a sub select for the day (if needed) | |
Select Case (DatePart("m", now)) | |
case 1 ' January | |
Select Case (DatePart("d", now)) | |
case 1, 2, 3, 4, 5, 6, 7, 8, 9 | |
Echo("Happy New Year!") | |
End Select |
This file contains 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
' Assign Favorites Based on OU | |
' Written by Adam "Arcath" Laycock | |
' December 2011 | |
' Variables | |
Set WshNetwork = WScript.CreateObject("WScript.Network") | |
Set objShell=CreateObject("Wscript.Shell" ) 'Create the Shell Object | |
favUnc = "\\hpml350\School Folders\Pupil Favorites\" ' Set This to the UNC path for your favorits folder |
This file contains 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 FindProxyForURL(url, host){ | |
/* Lancashire Proxy */ | |
proxy1 = "PROXY proxy.company1.com:8080; DIRECT"; | |
/* Cumbria Proxy */ | |
proxy2 = "PROXY proxy.company2.com:8080; DIRECT"; | |
/* Set proxy to Direct as the default */ | |
proxy = "DIRECT"; | |
This file contains 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 FindProxyForURL(url, host){ | |
/* The IP Range in the form 10.X.X (miss off digit 4) */ | |
iprange = "10.0.0"; | |
/* The Subnet */ | |
subnet = "255.255.255.0"; | |
/* The Domain Name */ | |
localdomain = "school.local"; |
This file contains 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
upcaser = Markabb::Callback.new(Proc.new { |s| | |
s.upcase | |
}) | |
Markabb.register_tag :upcase, Markabb::Tag.new('up', upcaser) | |
"[up]FooBAr[/up]".markabb # > FOOBAR |
This file contains 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 | |
$config = array( | |
'url'=>'https:/yoursite.com/api/tickets.json', | |
'key'=> $_POST['apiKey'] | |
); | |
$data = array( | |
'name' => $_POST['name'], | |
'email' => $_POST['email'], | |
'subject' => $_POST['subject'], |
This file contains 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
# | |
# Recommended minimum configuration: | |
# | |
# Example rule allowing access from your local networks. | |
# Adapt to list your (internal) IP networks from where browsing | |
# should be allowed | |
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network | |
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network | |
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network |