" )
+ .attr({
+ id: id,
+ role: "tooltip"
+ })
+ .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
+ ( this.options.tooltipClass || "" ) );
+ $( "
" )
+ .addClass( "ui-tooltip-content" )
+ .appendTo( tooltip );
+ tooltip.appendTo( this.document[0].body );
+ this.tooltips[ id ] = element;
+ return tooltip;
+ },
+
+ _find: function( target ) {
+ var id = target.data( "ui-tooltip-id" );
+ return id ? $( "#" + id ) : $();
+ },
+
+ _removeTooltip: function( tooltip ) {
+ tooltip.remove();
+ delete this.tooltips[ tooltip.attr( "id" ) ];
+ },
+
+ _destroy: function() {
+ var that = this;
+
+ // close open tooltips
+ $.each( this.tooltips, function( id, element ) {
+ // Delegate to close method to handle common cleanup
+ var event = $.Event( "blur" );
+ event.target = event.currentTarget = element[0];
+ that.close( event, true );
+
+ // Remove immediately; destroying an open tooltip doesn't use the
+ // hide animation
+ $( "#" + id ).remove();
+
+ // Restore the title
+ if ( element.data( "ui-tooltip-title" ) ) {
+ element.attr( "title", element.data( "ui-tooltip-title" ) );
+ element.removeData( "ui-tooltip-title" );
+ }
+ });
+ }
+});
+
+}( jQuery ) );
\ No newline at end of file
diff --git a/js/myAccount.js b/js/myAccount.js
new file mode 100644
index 0000000..d1f48fa
--- /dev/null
+++ b/js/myAccount.js
@@ -0,0 +1,447 @@
+function change_case() {
+ document.myForm.user.value = document.myForm.user.value.toLowerCase();
+}
+
+function check_Spacess(Generic)
+{
+ if (Generic === "") {
+ return false;
+ } else {
+ return true;
+ }
+}
+
+function formCheck()
+{
+ if (!check_Spacess(document.myForm.user.value))
+ {
+ alert("Please Fill out Account Name.");
+ document.myForm.user.focus();
+ document.myForm.user.select();
+ return false;
+ }
+
+ if (!check_Spacess(document.myForm.pass.value)) {
+ alert("Please Fill out Current Password.");
+ document.myForm.pass.focus();
+ document.myForm.pass.select();
+ return false;
+ }
+
+ if (!check_Spacess(document.myForm.passnew.value)) {
+ alert("Please Fill out new Password.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (!check_Spacess(document.myForm.again.value)) {
+ alert("Please Fill out new password again.");
+ document.myForm.again.focus();
+ document.myForm.again.select();
+ return false;
+ }
+
+ if (document.myForm.user.value.length < 2) {
+ alert("Username must be more than 2 characters. Please try again.");
+ document.myForm.user.focus();
+ document.myForm.user.select();
+ return false;
+ }
+
+ if (document.myForm.pass.value.length < 8 || document.myForm.pass.value.length > 64) {
+ alert("Password must be at least 6 characters and no more than 64 characters.");
+ document.myForm.pass.focus();
+ document.myForm.pass.select();
+ return false;
+ }
+
+ if (document.myForm.passnew.value.length < 8 || document.myForm.passnew.value.length > 64) {
+ alert("Password must be at least 8 characters and no more than 64 characters. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (document.myForm.passnew.value !== document.myForm.again.value) {
+ alert("New passwords do not match. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (document.myForm.pass.value === document.myForm.passnew.value) {
+ alert("New password can not be the same as the original password. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ var pattern1 = /\d{1,}/;
+ var pattern2 = /(?=.*[a-zA-Z].*[a-zA-Z])/;
+ var exclude1 = /\@/;
+ var exclude2 = /\*/;
+ var exclude3 = /\|/;
+ var exclude4 = /\,/;
+ var exclude5 = /\"/;
+ var exclude6 = /\:/;
+ var exclude7 = /\;/;
+ var exclude8 = /\ /;
+ var exclude9 = /\&/;
+ var exclude10 = /\\/;
+ var exclude11 = /\$/;
+ var exclude12 = /\~/;
+ var exclude13 = /\`/;
+ var exclude14 = /\'/;
+ var exclude15 = /\%/;
+ var exclude16 = /\^/;
+ var exclude17 = /\(/;
+ var exclude18 = /\)/;
+ var exclude19 = /\;
+ var exclude20 = /\>/;
+ var exclude21 = /\#/;
+
+ if (pattern1.test(document.myForm.passnew.value.substring(0, 8)) !== true) {
+ alert("New password needs at least one numerical character within the first eight characters. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+
+
+ if (pattern2.test(document.myForm.passnew.value.substring(0, 8)) !== true) {
+ alert("New password needs at least two alphabetical characters within the first eight characters. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+
+
+ if (exclude1.test(document.myForm.passnew.value)) {
+ alert("New password can not contain the '@' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude2.test(document.myForm.passnew.value)) {
+ alert("New password can not contain the '*' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude3.test(document.myForm.passnew.value)) {
+ alert("New password can not contain the '|' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude4.test(document.myForm.passnew.value)) {
+ alert("New password can not contain the ',' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude5.test(document.myForm.passnew.value)) {
+ alert("New password can not contain the ' \" ' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude6.test(document.myForm.passnew.value)) {
+ alert("New password can not contain the ':' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude7.test(document.myForm.passnew.value)) {
+ alert("New password can not contain the ';' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude8.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a space symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude9.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a '&' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude10.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a '\\' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude11.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a '$' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude12.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a '~' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude13.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a '`' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude14.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a ''' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude15.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a '%' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude16.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a '^' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude17.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a '(' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude18.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a ')' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude19.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a '<' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude20.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a '>' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+
+ if (exclude21.test(document.myForm.passnew.value)) {
+ alert("New password can not contain a '#' symbol. Please try again.");
+ document.myForm.passnew.focus();
+ document.myForm.passnew.select();
+ return false;
+ }
+}
+
+function testMinOccurrences(pattern, string, minDesired)
+{
+ if (string.match(pattern) === null || string.match(pattern).length < minDesired)
+ return false;
+ else
+ return true;
+}
+
+function testPassword(passwd)
+{
+ var description = new Array();
+
+ description[0] = "
New Password Strength: Weakest
";
+ description[1] = "
New Password Strength: Weak
";
+ description[2] = "
New Password Strength: Medium
";
+ description[3] = "
New Password Strength: Strong
";
+ description[4] = "
New Password Strength: Strongest
";
+ description[5] = "
New Password Strength: Strength will be displayed as password is entered
";
+
+ var intScore = 0;
+ var strVerdict = 0;
+
+ // PASSWORD LENGTH
+ if (passwd.length === 0 || !passwd.length) // length 0
+ {
+ intScore = -1;
+ }
+ else if (passwd.length > 0 && passwd.length < 8) // length between 1 and 4
+ {
+ intScore += 3;
+ }
+ else if (passwd.length > 5 && passwd.length < 8) // length between 5 and 7
+ {
+ intScore += 6;
+ }
+ else if (passwd.length > 7 && passwd.length < 15)// length between 8 and 16
+ {
+ intScore += 12;
+ }
+ else if (passwd.length > 15) // length 16 or more
+ {
+ intScore += 18;
+ }
+
+ // LETTERS (Not exactly implemented as dictacted above because of my limited understanding of Regex)
+ if (passwd.match(/[a-z]/)) // [verified] at least one lower case letter
+ {
+ intScore += 1;
+ }
+ if (passwd.match(/[A-Z]/)) // [verified] at least one upper case letter
+ {
+ intScore += 5;
+ }
+
+ // NUMBERS
+ if (passwd.match(/\d+/)) // [verified] at least one number
+ {
+ intScore += 5;
+ }
+ if (passwd.match(/(.*[0-9].*[0-9].*[0-9])/)) // [verified] at least three numbers
+ {
+ intScore += 5;
+ }
+
+ // SPECIAL CHAR
+ if (passwd.match(/.[!,$,%,^,&,?,_,~]/)) // [verified] at least one special character
+ {
+ intScore += 5;
+ }
+
+ // [verified] at least two special characters
+ if (passwd.match(/(.*[!,$,%,^,&,?,_,~].*[!,$,%,^,&,?,_,~])/))
+ {
+ intScore += 5;
+ }
+
+ // COMBOS
+ if (passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) // [verified] both upper and lower case
+ {
+ intScore += 2;
+ }
+ if (passwd.match(/(\d.*\D)|(\D.*\d)/)) // [FAILED] both letters and numbers, almost works because an additional character is required
+ {
+ intScore += 2;
+ }
+
+ // [verified] letters, numbers, and special characters
+ if (passwd.match(/([a-zA-Z0-9].*[!,$,%,^,&,?,_,~])|([!,$,%,^,&,?,_,~].*[a-zA-Z0-9])/))
+ {
+ intScore += 2;
+ }
+ if (intScore === -1)
+ {
+ strVerdict = description[5];
+ }
+ else if (intScore > -1 && intScore < 16)
+ {
+ strVerdict = description[0];
+ }
+ else if (intScore > 15 && intScore < 25)
+ {
+ strVerdict = description[1];
+ }
+ else if (intScore > 24 && intScore < 35)
+ {
+ strVerdict = description[2];
+ }
+ else if (intScore > 34 && intScore < 45)
+ {
+ strVerdict = description[3];
+ }
+ else
+ {
+ strVerdict = description[4];
+ }
+ document.getElementById("Words").innerHTML = (strVerdict);
+}
+
+$(document).ready(function() {
+ $(".slidingDivAbout, .slidingDivAboutArr, .slidingDivContact, .slidingDivContactArr, .slidingDivContact1, .slidingDivContact1Arr").hide(0);
+
+ $('.show_hideAbout').click(function() {
+ $(".slidingDivContact").slideUp(300, function() {
+ $(".slidingDivContactArr").fadeOut(300, function() {
+ $(".slidingDivAbout").slideToggle(350, "linear", function() {
+ $(".slidingDivAboutArr").fadeToggle(350);
+ });
+ });
+ });
+ });
+ $('.show_hideAbout').click(function() {
+ $(".slidingDivContact1").slideUp(300, function() {
+ $(".slidingDivContact1Arr").fadeOut(300, function() {
+ });
+ });
+ });
+ $('.show_hideContact').click(function() {
+ $(".slidingDivAbout").slideUp(300, function() {
+ $(".slidingDivAboutArr").fadeOut(300, function() {
+ $(".slidingDivContact").slideToggle(350, function() {
+ $(".slidingDivContactArr").fadeToggle(350, "linear");
+ });
+ });
+ });
+ });
+ $('.show_hideContact').click(function() {
+ $(".slidingDivContact1").slideUp(300, function() {
+ $(".slidingDivContact1Arr").fadeOut(300, function() {
+
+ });
+ });
+ });
+ $('.show_hideContact1').click(function() {
+ $(".slidingDivContact").slideUp(300, function() {
+ $(".slidingDivContactArr").fadeOut(300, function() {
+ $(".slidingDivContact1").slideToggle(350, function() {
+ $(".slidingDivContact1Arr").fadeToggle(350, "linear");
+ });
+ });
+ });
+ });
+ $('.show_hideContact1').click(function() {
+ $(".slidingDivAbout").slideUp(300, function() {
+ $(".slidingDivAboutArr").fadeOut(300, function() {
+
+ });
+ });
+ });
+});
+
+$(document).ready(function() {
+ $('#submissionTextArea').bind("cut copy paste", function(e) {
+ e.preventDefault();
+ $('#submissionTextArea').bind("contextmenu", function(e) {
+ e.preventDefault();
+ });
+ });
+});
\ No newline at end of file
diff --git a/js/python.js b/js/python.js
new file mode 100644
index 0000000..951aaf8
--- /dev/null
+++ b/js/python.js
@@ -0,0 +1,340 @@
+CodeMirror.defineMode("python", function(conf, parserConf) {
+ var ERRORCLASS = 'error';
+
+ function wordRegexp(words) {
+ return new RegExp("^((" + words.join(")|(") + "))\\b");
+ }
+
+ var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]");
+ var singleDelimiters = parserConf.singleDelimiters || new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]');
+ var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))");
+ var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");
+ var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");
+ var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
+
+ var wordOperators = wordRegexp(['and', 'or', 'not', 'is', 'in']);
+ var commonkeywords = ['as', 'assert', 'break', 'class', 'continue',
+ 'def', 'del', 'elif', 'else', 'except', 'finally',
+ 'for', 'from', 'global', 'if', 'import',
+ 'lambda', 'pass', 'raise', 'return',
+ 'try', 'while', 'with', 'yield'];
+ var commonBuiltins = ['abs', 'all', 'any', 'bin', 'bool', 'bytearray', 'callable', 'chr',
+ 'classmethod', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod',
+ 'enumerate', 'eval', 'filter', 'float', 'format', 'frozenset',
+ 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id',
+ 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len',
+ 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next',
+ 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
+ 'repr', 'reversed', 'round', 'set', 'setattr', 'slice',
+ 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple',
+ 'type', 'vars', 'zip', '__import__', 'NotImplemented',
+ 'Ellipsis', '__debug__'];
+ var py2 = {'builtins': ['apply', 'basestring', 'buffer', 'cmp', 'coerce', 'execfile',
+ 'file', 'intern', 'long', 'raw_input', 'reduce', 'reload',
+ 'unichr', 'unicode', 'xrange', 'False', 'True', 'None'],
+ 'keywords': ['exec', 'print']};
+ var py3 = {'builtins': ['ascii', 'bytes', 'exec', 'print'],
+ 'keywords': ['nonlocal', 'False', 'True', 'None']};
+
+ if (!!parserConf.version && parseInt(parserConf.version, 10) === 3) {
+ commonkeywords = commonkeywords.concat(py3.keywords);
+ commonBuiltins = commonBuiltins.concat(py3.builtins);
+ var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i");
+ } else {
+ commonkeywords = commonkeywords.concat(py2.keywords);
+ commonBuiltins = commonBuiltins.concat(py2.builtins);
+ var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i");
+ }
+ var keywords = wordRegexp(commonkeywords);
+ var builtins = wordRegexp(commonBuiltins);
+
+ var indentInfo = null;
+
+ // tokenizers
+ function tokenBase(stream, state) {
+ // Handle scope changes
+ if (stream.sol()) {
+ var scopeOffset = state.scopes[0].offset;
+ if (stream.eatSpace()) {
+ var lineOffset = stream.indentation();
+ if (lineOffset > scopeOffset) {
+ indentInfo = 'indent';
+ } else if (lineOffset < scopeOffset) {
+ indentInfo = 'dedent';
+ }
+ return null;
+ } else {
+ if (scopeOffset > 0) {
+ dedent(stream, state);
+ }
+ }
+ }
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ var ch = stream.peek();
+
+ // Handle Comments
+ if (ch === '#') {
+ stream.skipToEnd();
+ return 'comment';
+ }
+
+ // Handle Number Literals
+ if (stream.match(/^[0-9\.]/, false)) {
+ var floatLiteral = false;
+ // Floats
+ if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; }
+ if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; }
+ if (stream.match(/^\.\d+/)) { floatLiteral = true; }
+ if (floatLiteral) {
+ // Float literals may be "imaginary"
+ stream.eat(/J/i);
+ return 'number';
+ }
+ // Integers
+ var intLiteral = false;
+ // Hex
+ if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; }
+ // Binary
+ if (stream.match(/^0b[01]+/i)) { intLiteral = true; }
+ // Octal
+ if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; }
+ // Decimal
+ if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {
+ // Decimal literals may be "imaginary"
+ stream.eat(/J/i);
+ // TODO - Can you have imaginary longs?
+ intLiteral = true;
+ }
+ // Zero by itself with no other piece of number.
+ if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; }
+ if (intLiteral) {
+ // Integer literals may be "long"
+ stream.eat(/L/i);
+ return 'number';
+ }
+ }
+
+ // Handle Strings
+ if (stream.match(stringPrefixes)) {
+ state.tokenize = tokenStringFactory(stream.current());
+ return state.tokenize(stream, state);
+ }
+
+ // Handle operators and Delimiters
+ if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) {
+ return null;
+ }
+ if (stream.match(doubleOperators)
+ || stream.match(singleOperators)
+ || stream.match(wordOperators)) {
+ return 'operator';
+ }
+ if (stream.match(singleDelimiters)) {
+ return null;
+ }
+
+ if (stream.match(keywords)) {
+ return 'keyword';
+ }
+
+ if (stream.match(builtins)) {
+ return 'builtin';
+ }
+
+ if (stream.match(identifiers)) {
+ return 'variable';
+ }
+
+ // Handle non-detected items
+ stream.next();
+ return ERRORCLASS;
+ }
+
+ function tokenStringFactory(delimiter) {
+ while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
+ delimiter = delimiter.substr(1);
+ }
+ var singleline = delimiter.length == 1;
+ var OUTCLASS = 'string';
+
+ function tokenString(stream, state) {
+ while (!stream.eol()) {
+ stream.eatWhile(/[^'"\\]/);
+ if (stream.eat('\\')) {
+ stream.next();
+ if (singleline && stream.eol()) {
+ return OUTCLASS;
+ }
+ } else if (stream.match(delimiter)) {
+ state.tokenize = tokenBase;
+ return OUTCLASS;
+ } else {
+ stream.eat(/['"]/);
+ }
+ }
+ if (singleline) {
+ if (parserConf.singleLineStringErrors) {
+ return ERRORCLASS;
+ } else {
+ state.tokenize = tokenBase;
+ }
+ }
+ return OUTCLASS;
+ }
+ tokenString.isString = true;
+ return tokenString;
+ }
+
+ function indent(stream, state, type) {
+ type = type || 'py';
+ var indentUnit = 0;
+ if (type === 'py') {
+ if (state.scopes[0].type !== 'py') {
+ state.scopes[0].offset = stream.indentation();
+ return;
+ }
+ for (var i = 0; i < state.scopes.length; ++i) {
+ if (state.scopes[i].type === 'py') {
+ indentUnit = state.scopes[i].offset + conf.indentUnit;
+ break;
+ }
+ }
+ } else {
+ indentUnit = stream.column() + stream.current().length;
+ }
+ state.scopes.unshift({
+ offset: indentUnit,
+ type: type
+ });
+ }
+
+ function dedent(stream, state, type) {
+ type = type || 'py';
+ if (state.scopes.length == 1) return;
+ if (state.scopes[0].type === 'py') {
+ var _indent = stream.indentation();
+ var _indent_index = -1;
+ for (var i = 0; i < state.scopes.length; ++i) {
+ if (_indent === state.scopes[i].offset) {
+ _indent_index = i;
+ break;
+ }
+ }
+ if (_indent_index === -1) {
+ return true;
+ }
+ while (state.scopes[0].offset !== _indent) {
+ state.scopes.shift();
+ }
+ return false;
+ } else {
+ if (type === 'py') {
+ state.scopes[0].offset = stream.indentation();
+ return false;
+ } else {
+ if (state.scopes[0].type != type) {
+ return true;
+ }
+ state.scopes.shift();
+ return false;
+ }
+ }
+ }
+
+ function tokenLexer(stream, state) {
+ indentInfo = null;
+ var style = state.tokenize(stream, state);
+ var current = stream.current();
+
+ // Handle '.' connected identifiers
+ if (current === '.') {
+ style = stream.match(identifiers, false) ? null : ERRORCLASS;
+ if (style === null && state.lastToken === 'meta') {
+ // Apply 'meta' style to '.' connected identifiers when
+ // appropriate.
+ style = 'meta';
+ }
+ return style;
+ }
+
+ // Handle decorators
+ if (current === '@') {
+ return stream.match(identifiers, false) ? 'meta' : ERRORCLASS;
+ }
+
+ if ((style === 'variable' || style === 'builtin')
+ && state.lastToken === 'meta') {
+ style = 'meta';
+ }
+
+ // Handle scope changes.
+ if (current === 'pass' || current === 'return') {
+ state.dedent += 1;
+ }
+ if (current === 'lambda') state.lambda = true;
+ if ((current === ':' && !state.lambda && state.scopes[0].type == 'py')
+ || indentInfo === 'indent') {
+ indent(stream, state);
+ }
+ var delimiter_index = '[({'.indexOf(current);
+ if (delimiter_index !== -1) {
+ indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1));
+ }
+ if (indentInfo === 'dedent') {
+ if (dedent(stream, state)) {
+ return ERRORCLASS;
+ }
+ }
+ delimiter_index = '])}'.indexOf(current);
+ if (delimiter_index !== -1) {
+ if (dedent(stream, state, current)) {
+ return ERRORCLASS;
+ }
+ }
+ if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'py') {
+ if (state.scopes.length > 1) state.scopes.shift();
+ state.dedent -= 1;
+ }
+
+ return style;
+ }
+
+ var external = {
+ startState: function(basecolumn) {
+ return {
+ tokenize: tokenBase,
+ scopes: [{offset:basecolumn || 0, type:'py'}],
+ lastToken: null,
+ lambda: false,
+ dedent: 0
+ };
+ },
+
+ token: function(stream, state) {
+ var style = tokenLexer(stream, state);
+
+ state.lastToken = style;
+
+ if (stream.eol() && stream.lambda) {
+ state.lambda = false;
+ }
+
+ return style;
+ },
+
+ indent: function(state) {
+ if (state.tokenize != tokenBase) {
+ return state.tokenize.isString ? CodeMirror.Pass : 0;
+ }
+
+ return state.scopes[0].offset;
+ }
+
+ };
+ return external;
+});
+
+CodeMirror.defineMIME("text/x-python", "python");
diff --git a/login.php b/login.php
new file mode 100644
index 0000000..86c9d0f
--- /dev/null
+++ b/login.php
@@ -0,0 +1,73 @@
+ 2592000) {
+ session_unset();
+ session_destroy();
+ header("Location:../shared_php/session_expired.php");
+ }
+ } else if (time() - $_SESSION['lastActivity'] > 1800) {
+ session_unset();
+ session_destroy();
+ header("Location:../shared_php/session_expired.php");
+ }
+} else {
+$_SESSION['lastActivity'] = time(); // update last activity time stamp
+}
+
+$email = $_POST["username"];
+$passwordHash = md5($_POST["password"]);
+$query = "SELECT idMember, FirstName, LastName, IsInstructor, MemberBanner FROM Member WHERE MemberEmail='$email' AND MemberPassword='$passwordHash'";
+$result = mysql_query($query);
+
+if (mysql_num_rows($result) == 1) {
+ //create all session variables required for user
+
+
+ $memberData = mysql_fetch_array($result);
+ $_SESSION['start'] = time(); // get current time
+ $_SESSION['expire'] = $_SESSION['start'] + (30 * 60) ; // ends the session in 30 minutes from starting time
+ $_SESSION['email'] = $email;
+ $_SESSION['firstname'] = $memberData['FirstName'];
+ $_SESSION['lastname'] = $memberData['LastName'];
+ $_SESSION['memberbanner'] = $memberData['MemberBanner'];
+ $_SESSION['idmember'] = $memberData['idMember'];
+ $_SESSION['isinstructor'] = $memberData['IsInstructor'];
+$_SESSION['uniqueID']=uniqid ();
+ $log = KLogger::instance(dirname(__FILE__) . '/files/log'.$_SESSION['uniqueID'], KLogger::INFO);
+ $log->logInfo('dirname(__FILE__)=',dirname(__FILE__) );
+ //redirect to instructor interface (active courses)
+ if ($_SESSION['isinstructor'] == 1) {
+ header("Location:instructor/acourses.php");
+ }
+
+ //redirect to student interface (my courses)
+ else if ($_SESSION['isinstructor'] == 0) {
+ header("Location:student/myCourses.php");
+ }
+
+ //else contact system admin
+ else {
+ echo "ERROR: neither a student nor an instructor; please contact a systen administrator";
+ }
+}
+else {
+ //redirect to login and (in red text) state "username or password incorrect"
+ echo "Either there is no user with that login combination, or there is more than one user with that combination";
+}
+ $_SESSION['log']->LogInfo("after login");
+ echo "after login";
+
+?>
diff --git a/shared_php/.svn/all-wcprops b/shared_php/.svn/all-wcprops
new file mode 100644
index 0000000..d25815b
--- /dev/null
+++ b/shared_php/.svn/all-wcprops
@@ -0,0 +1,83 @@
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/courses/cs49901-trac/svn/!svn/ver/2267/S2013/Web/shared_php
+END
+logout.php
+K 25
+svn:wc:ra_dav:version-url
+V 71
+/courses/cs49901-trac/svn/!svn/ver/2172/S2013/Web/shared_php/logout.php
+END
+practice.php
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/courses/cs49901-trac/svn/!svn/ver/2255/S2013/Web/shared_php/practice.php
+END
+viewNotif.php
+K 25
+svn:wc:ra_dav:version-url
+V 74
+/courses/cs49901-trac/svn/!svn/ver/2271/S2013/Web/shared_php/viewNotif.php
+END
+changePass.php
+K 25
+svn:wc:ra_dav:version-url
+V 75
+/courses/cs49901-trac/svn/!svn/ver/2261/S2013/Web/shared_php/changePass.php
+END
+forget_pass.php
+K 25
+svn:wc:ra_dav:version-url
+V 76
+/courses/cs49901-trac/svn/!svn/ver/2137/S2013/Web/shared_php/forget_pass.php
+END
+databaseConnect.php
+K 25
+svn:wc:ra_dav:version-url
+V 80
+/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/shared_php/databaseConnect.php
+END
+footer.php
+K 25
+svn:wc:ra_dav:version-url
+V 71
+/courses/cs49901-trac/svn/!svn/ver/1969/S2013/Web/shared_php/footer.php
+END
+passChanged.php
+K 25
+svn:wc:ra_dav:version-url
+V 76
+/courses/cs49901-trac/svn/!svn/ver/1929/S2013/Web/shared_php/passChanged.php
+END
+myAccount.php
+K 25
+svn:wc:ra_dav:version-url
+V 74
+/courses/cs49901-trac/svn/!svn/ver/2235/S2013/Web/shared_php/myAccount.php
+END
+saveForm.php
+K 25
+svn:wc:ra_dav:version-url
+V 73
+/courses/cs49901-trac/svn/!svn/ver/1929/S2013/Web/shared_php/saveForm.php
+END
+session_expired.php
+K 25
+svn:wc:ra_dav:version-url
+V 80
+/courses/cs49901-trac/svn/!svn/ver/2172/S2013/Web/shared_php/session_expired.php
+END
+saveForm_conf.php
+K 25
+svn:wc:ra_dav:version-url
+V 78
+/courses/cs49901-trac/svn/!svn/ver/1926/S2013/Web/shared_php/saveForm_conf.php
+END
+header.php
+K 25
+svn:wc:ra_dav:version-url
+V 71
+/courses/cs49901-trac/svn/!svn/ver/2271/S2013/Web/shared_php/header.php
+END
diff --git a/shared_php/.svn/entries b/shared_php/.svn/entries
new file mode 100644
index 0000000..7af7b30
--- /dev/null
+++ b/shared_php/.svn/entries
@@ -0,0 +1,470 @@
+10
+
+dir
+2270
+http://classes.cs.kent.edu/courses/cs49901-trac/svn/S2013/Web/shared_php
+http://classes.cs.kent.edu/courses/cs49901-trac/svn
+
+
+
+2013-05-01T19:07:34.490069Z
+2267
+aalmahai
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6b56fd01-43f3-4ec1-838e-340f7da2cd71
+
+logout.php
+file
+
+
+
+
+2013-05-01T21:08:45.000000Z
+222f51e1bd7914c3e25dd70e47046504
+2013-04-19T14:32:44.076912Z
+2172
+pedwards
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+157
+
+practice.php
+file
+
+
+
+
+2013-05-01T21:08:45.000000Z
+1508c69fab053cf00b158a259404ce78
+2013-04-30T01:40:39.157058Z
+2255
+talrefai
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5640
+
+viewNotif.php
+file
+2271
+
+
+
+2013-05-01T21:07:00.000000Z
+13f386af7eab8c1a99925d09bc6f1f71
+2013-05-01T21:13:54.634079Z
+2271
+aalmahai
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2487
+
+changePass.php
+file
+
+
+
+
+2013-05-01T21:08:45.000000Z
+e0c2bdcc4daf77a07bb510ea86e7a890
+2013-04-30T07:01:15.828385Z
+2261
+aalmahai
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1279
+
+forget_pass.php
+file
+
+
+
+
+2013-05-01T21:08:45.000000Z
+3cb6afc512c9958f620af65878dc4493
+2013-04-12T03:06:14.972317Z
+2137
+ckerstin
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5059
+
+databaseConnect.php
+file
+
+
+
+
+2013-05-01T21:08:45.000000Z
+1225c2f686074a0512c0c56ccd9db70d
+2013-03-08T04:08:12.118316Z
+1926
+pedwards
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+467
+
+footer.php
+file
+
+
+
+
+2013-05-01T21:08:45.000000Z
+262510f80b1a5f4d3efc6615afa806ab
+2013-03-14T22:22:25.330158Z
+1969
+pedwards
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+34
+
+passChanged.php
+file
+
+
+
+
+2013-05-01T21:08:45.000000Z
+42448ec584b561874723cc984acb6403
+2013-03-08T04:30:08.885564Z
+1929
+pedwards
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+771
+
+myAccount.php
+file
+
+
+
+
+2013-05-01T21:08:45.000000Z
+8197a7498825208a6d22d949265ef97b
+2013-04-25T05:18:34.664849Z
+2235
+aalmahai
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+580
+
+saveForm.php
+file
+
+
+
+
+2013-05-01T21:08:45.000000Z
+adf361f296091f917a437cc143c28506
+2013-03-08T04:30:08.885564Z
+1929
+pedwards
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1276
+
+session_expired.php
+file
+
+
+
+
+2013-05-01T21:08:45.000000Z
+fec4362540526323a903b7f561692638
+2013-04-19T14:32:44.076912Z
+2172
+pedwards
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+229
+
+saveForm_conf.php
+file
+
+
+
+
+2013-05-01T21:08:45.000000Z
+c34c329cda91db94108497dd8c93d031
+2013-03-08T04:08:12.118316Z
+1926
+pedwards
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1335
+
+header.php
+file
+2271
+
+
+
+2013-05-01T21:03:13.000000Z
+884ddf5e3214941f7032e2332c87de27
+2013-05-01T21:13:54.634079Z
+2271
+aalmahai
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5318
+
diff --git a/shared_php/.svn/text-base/changePass.php.svn-base b/shared_php/.svn/text-base/changePass.php.svn-base
new file mode 100644
index 0000000..c3b1e9b
--- /dev/null
+++ b/shared_php/.svn/text-base/changePass.php.svn-base
@@ -0,0 +1,33 @@
+
+
+
\ No newline at end of file
diff --git a/shared_php/.svn/text-base/databaseConnect.php.svn-base b/shared_php/.svn/text-base/databaseConnect.php.svn-base
new file mode 100644
index 0000000..dacb630
--- /dev/null
+++ b/shared_php/.svn/text-base/databaseConnect.php.svn-base
@@ -0,0 +1,14 @@
+
\ No newline at end of file
diff --git a/shared_php/.svn/text-base/footer.php.svn-base b/shared_php/.svn/text-base/footer.php.svn-base
new file mode 100644
index 0000000..0f7d808
--- /dev/null
+++ b/shared_php/.svn/text-base/footer.php.svn-base
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/shared_php/.svn/text-base/forget_pass.php.svn-base b/shared_php/.svn/text-base/forget_pass.php.svn-base
new file mode 100644
index 0000000..5b00ef8
--- /dev/null
+++ b/shared_php/.svn/text-base/forget_pass.php.svn-base
@@ -0,0 +1,163 @@
+
+
+
+
+
+
+
+
+
+
+ exit;
+}
+
+//This functions checks and makes sure the email address that is being added to database is valid in format.
+function check_email_address($email) {
+ // First, we check that there's one @ symbol, and that the lengths are right
+ if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
+ // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
+ return false;
+ }
+ // Split it into sections to make life easier
+ $email_array = explode("@", $email);
+ $local_array = explode(".", $email_array[0]);
+ for ($i = 0; $i < sizeof($local_array); $i++) {
+ if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
+ return false;
+ }
+ }
+ if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name
+ $domain_array = explode(".", $email_array[1]);
+ if (sizeof($domain_array) < 2) {
+ return false; // Not enough parts to domain
+ }
+ for ($i = 0; $i < sizeof($domain_array); $i++) {
+ if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+if (isset($_POST['submit'])) {
+
+ if ($_POST['forgotpassword']=='') {
+ error('Please Fill in Email.');
+ }
+ if(get_magic_quotes_gpc()) {
+ $forgotpassword = htmlspecialchars(stripslashes($_POST['forgotpassword']));
+ }
+ else {
+ $forgotpassword = htmlspecialchars($_POST['forgotpassword']);
+ }
+ //Make sure it's a valid email address, last thing we want is some sort of exploit!
+ if (!check_email_address($_POST['forgotpassword'])) {
+ error('Email Not Valid - Must be in format of name@domain.tld');
+ }
+ // Lets see if the email exists
+ $sql = "SELECT COUNT(*) FROM Member WHERE MemberEmail = '$forgotpassword'";
+ $result = mysql_query($sql)or die('Could not find member: ' . mysql_error());
+ if (!mysql_result($result,0,0)>0) {
+ error('Email Not Found!');
+ }
+/*
+INSTEAD OF THIS, SET PASSWORD BACK TO BANNER ID
+ //Generate a RANDOM MD5 Hash for a password
+ $random_password=md5(uniqid(rand()));
+
+ //Take the first 8 digits and use them as the password we intend to email the user
+ $emailpassword=substr($random_password, 0, 8);
+
+ //Encrypt $emailpassword in MD5 format for the database
+ $newpassword = md5($emailpassword);
+
+*/
+
+ $query_getbanner = "SELECT MemberBanner FROM Member WHERE MemberEmail = '" . $_POST['forgotpassword']."'";
+ $result = mysql_query($query_getbanner);
+ $row = mysql_fetch_array($result);
+ $newpassword = md5($row['MemberBanner']);
+
+ // Make a safe query
+ $query = sprintf("UPDATE `Member` SET `MemberPassword` = '%s'
+ WHERE `MemberEmail` = '$forgotpassword'",
+ mysql_real_escape_string($newpassword));
+
+ mysql_query($query)or die('Could not update members: ' . mysql_error());
+
+//Email out the infromation
+$subject = "Your New Password";
+$message = "Your new password is as follows:
+----------------------------
+Password: $emailpassword
+----------------------------
+Please make note this information has been encrypted into our database
+
+This email was automatically generated.";
+
+ if(!mail($forgotpassword, $subject, $message, "FROM: $site_name <$site_email>")){
+ die ("Sending Email Failed, Please Contact Site Admin! ($site_email)");
+ }else{
+ error('New Password Sent!.');
+ }
+
+ }
+
+else {
+?>
+
+
+
+
Forget Password
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+?>
+
diff --git a/shared_php/.svn/text-base/header.php.svn-base b/shared_php/.svn/text-base/header.php.svn-base
new file mode 100644
index 0000000..6c3305f
--- /dev/null
+++ b/shared_php/.svn/text-base/header.php.svn-base
@@ -0,0 +1,166 @@
+ 2592000) {
+ session_unset();
+ session_destroy();
+ header("Location:../shared_php/session_expired.php");
+ }
+ } else if (time() - $_SESSION['lastActivity'] > 1800) {
+ session_unset();
+ session_destroy();
+ header("Location:../shared_php/session_expired.php");
+ }
+} else {
+ $_SESSION['lastActivity'] = time(); // update last activity time stamp
+}
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+";
+
+ } else { //they must be an instructor, output instructor buttons
+ echo " ";
+ }
+
+
+ ?>
+
+
+
\ No newline at end of file
diff --git a/shared_php/.svn/text-base/logout.php.svn-base b/shared_php/.svn/text-base/logout.php.svn-base
new file mode 100644
index 0000000..b030a26
--- /dev/null
+++ b/shared_php/.svn/text-base/logout.php.svn-base
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/shared_php/.svn/text-base/myAccount.php.svn-base b/shared_php/.svn/text-base/myAccount.php.svn-base
new file mode 100644
index 0000000..74e21d5
--- /dev/null
+++ b/shared_php/.svn/text-base/myAccount.php.svn-base
@@ -0,0 +1,20 @@
+
Change Password ";
+
+if ($_SESSION['isinstructor'] == 1) {
+ echo "
";
+}
+
+if ($_SESSION['isinstructor'] == 0) {
+
+echo "
";
+}
+if ($_SESSION['isinstructor'] == 0) {
+ echo "
";
+}
+
+include("../shared_php/footer.php");
+?>
diff --git a/shared_php/.svn/text-base/passChanged.php.svn-base b/shared_php/.svn/text-base/passChanged.php.svn-base
new file mode 100644
index 0000000..f472323
--- /dev/null
+++ b/shared_php/.svn/text-base/passChanged.php.svn-base
@@ -0,0 +1,22 @@
+ 0)
+ {
+ echo "Password Changed.\n";
+ }
+ else {echo "Password Was Not Changed.\nCheck your spelling and try again.\n";}
+
+ include("../shared_php/footer.php");
+?>
diff --git a/shared_php/.svn/text-base/practice.php.svn-base b/shared_php/.svn/text-base/practice.php.svn-base
new file mode 100644
index 0000000..b62655a
--- /dev/null
+++ b/shared_php/.svn/text-base/practice.php.svn-base
@@ -0,0 +1,185 @@
+
+
+
+
+
+
+
+
+
+ Code:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Output:
+
+
+
+
+
+
+
+ Variable
+ Value
+
+
+ y
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/shared_php/.svn/text-base/saveForm.php.svn-base b/shared_php/.svn/text-base/saveForm.php.svn-base
new file mode 100644
index 0000000..27f7251
--- /dev/null
+++ b/shared_php/.svn/text-base/saveForm.php.svn-base
@@ -0,0 +1,49 @@
+"
+ $_SESSION['txtname'] = $y;
+ $x = $_SESSION['txtname'];
+
+ //echo $x;
+}
+
+
+?>
+
+
+
+
+
+
Save Form
+
+
+
+
+
Please, fill the follwing form to save the code:
+
+ file name:
+
+ file extension:
+
+ choose from the list.
+ .cpp
+ .h
+ .py
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/shared_php/.svn/text-base/saveForm_conf.php.svn-base b/shared_php/.svn/text-base/saveForm_conf.php.svn-base
new file mode 100644
index 0000000..213825c
--- /dev/null
+++ b/shared_php/.svn/text-base/saveForm_conf.php.svn-base
@@ -0,0 +1,63 @@
+";
+
+$Pname = $_POST['pName'];
+$filext = $_POST['fileExt'];
+$txt1 = $_POST['txt1'];
+
+
+$tab = " ";
+$space= " ";
+$pa = str_replace("", "" , str_replace(" ", $space , str_replace("\t", $tab, $txt1)));
+
+
+if ($filext == '.cpp')
+{
+ $file = $Pname.$filext ;
+
+ file_put_contents($file, $txt1);
+
+ header('Content-Description: File Transfer');
+ header('Content-Type: application/text/x-c++src');
+ header('Content-Disposition: attachment; filename='.basename($file));
+ header('Content-Transfer-Encoding: binary');
+ echo "$txt1";
+
+}
+
+else if ($filext == '.h')
+{
+
+ $file = $Pname.$filext ;
+
+ file_put_contents($file, $txt1);
+
+ header('Content-Description: File Transfer');
+ header('Content-Type: application/text/x-chdr');
+ header('Content-Disposition: attachment; filename='.basename($file));
+
+ echo "$txt1";
+}
+else if ($filext == '.py')
+{
+ $file = $Pname.$filext ;
+
+ file_put_contents($file, $txt1);
+
+ header('Content-Description: File Transfer');
+ header('Content-Type: application/text/x-python');
+ header('Content-Disposition: attachment; filename='.basename($file));
+
+ echo "$txt1";
+
+}
+else
+{
+ echo "";
+ header('Refresh: 2; URL=saveForm.php');
+}
+
+?>
diff --git a/shared_php/.svn/text-base/session_expired.php.svn-base b/shared_php/.svn/text-base/session_expired.php.svn-base
new file mode 100644
index 0000000..1397a61
--- /dev/null
+++ b/shared_php/.svn/text-base/session_expired.php.svn-base
@@ -0,0 +1,10 @@
+
+
+
+";
+
+echo "Oops! Your session has expired! Please
click here or wait to be redirected";
+?>
\ No newline at end of file
diff --git a/shared_php/.svn/text-base/viewNotif.php.svn-base b/shared_php/.svn/text-base/viewNotif.php.svn-base
new file mode 100644
index 0000000..d33197e
--- /dev/null
+++ b/shared_php/.svn/text-base/viewNotif.php.svn-base
@@ -0,0 +1,101 @@
+
+
+
+
+
Notifications ");
+ while($data = mysql_fetch_row($result2)){
+
+ echo "
+
+
\ No newline at end of file
diff --git a/shared_php/forget_pass.php b/shared_php/forget_pass.php
new file mode 100644
index 0000000..5b00ef8
--- /dev/null
+++ b/shared_php/forget_pass.php
@@ -0,0 +1,163 @@
+
+
+
+
+
+
+
+
+
+
+ exit;
+}
+
+//This functions checks and makes sure the email address that is being added to database is valid in format.
+function check_email_address($email) {
+ // First, we check that there's one @ symbol, and that the lengths are right
+ if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
+ // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
+ return false;
+ }
+ // Split it into sections to make life easier
+ $email_array = explode("@", $email);
+ $local_array = explode(".", $email_array[0]);
+ for ($i = 0; $i < sizeof($local_array); $i++) {
+ if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
+ return false;
+ }
+ }
+ if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name
+ $domain_array = explode(".", $email_array[1]);
+ if (sizeof($domain_array) < 2) {
+ return false; // Not enough parts to domain
+ }
+ for ($i = 0; $i < sizeof($domain_array); $i++) {
+ if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+if (isset($_POST['submit'])) {
+
+ if ($_POST['forgotpassword']=='') {
+ error('Please Fill in Email.');
+ }
+ if(get_magic_quotes_gpc()) {
+ $forgotpassword = htmlspecialchars(stripslashes($_POST['forgotpassword']));
+ }
+ else {
+ $forgotpassword = htmlspecialchars($_POST['forgotpassword']);
+ }
+ //Make sure it's a valid email address, last thing we want is some sort of exploit!
+ if (!check_email_address($_POST['forgotpassword'])) {
+ error('Email Not Valid - Must be in format of name@domain.tld');
+ }
+ // Lets see if the email exists
+ $sql = "SELECT COUNT(*) FROM Member WHERE MemberEmail = '$forgotpassword'";
+ $result = mysql_query($sql)or die('Could not find member: ' . mysql_error());
+ if (!mysql_result($result,0,0)>0) {
+ error('Email Not Found!');
+ }
+/*
+INSTEAD OF THIS, SET PASSWORD BACK TO BANNER ID
+ //Generate a RANDOM MD5 Hash for a password
+ $random_password=md5(uniqid(rand()));
+
+ //Take the first 8 digits and use them as the password we intend to email the user
+ $emailpassword=substr($random_password, 0, 8);
+
+ //Encrypt $emailpassword in MD5 format for the database
+ $newpassword = md5($emailpassword);
+
+*/
+
+ $query_getbanner = "SELECT MemberBanner FROM Member WHERE MemberEmail = '" . $_POST['forgotpassword']."'";
+ $result = mysql_query($query_getbanner);
+ $row = mysql_fetch_array($result);
+ $newpassword = md5($row['MemberBanner']);
+
+ // Make a safe query
+ $query = sprintf("UPDATE `Member` SET `MemberPassword` = '%s'
+ WHERE `MemberEmail` = '$forgotpassword'",
+ mysql_real_escape_string($newpassword));
+
+ mysql_query($query)or die('Could not update members: ' . mysql_error());
+
+//Email out the infromation
+$subject = "Your New Password";
+$message = "Your new password is as follows:
+----------------------------
+Password: $emailpassword
+----------------------------
+Please make note this information has been encrypted into our database
+
+This email was automatically generated.";
+
+ if(!mail($forgotpassword, $subject, $message, "FROM: $site_name <$site_email>")){
+ die ("Sending Email Failed, Please Contact Site Admin! ($site_email)");
+ }else{
+ error('New Password Sent!.');
+ }
+
+ }
+
+else {
+?>
+
+
+
+
Forget Password
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+?>
+
diff --git a/shared_php/header.php b/shared_php/header.php
new file mode 100644
index 0000000..06650fd
--- /dev/null
+++ b/shared_php/header.php
@@ -0,0 +1,174 @@
+ 2592000) {
+ session_unset();
+ session_destroy();
+ header("Location:../shared_php/session_expired.php");
+ }
+ } else if (time() - $_SESSION['lastActivity'] > 1800) {
+ session_unset();
+ session_destroy();
+ header("Location:../shared_php/session_expired.php");
+ }
+} else {
+
+ $_SESSION['lastActivity'] = time(); // update last activity time stamp
+}
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+";
+
+ } else { //they must be an instructor, output instructor buttons
+ echo " ";
+ }
+
+
+ ?>
+
+
+
diff --git a/shared_php/logout.php b/shared_php/logout.php
new file mode 100644
index 0000000..b030a26
--- /dev/null
+++ b/shared_php/logout.php
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/shared_php/myAccount.php b/shared_php/myAccount.php
new file mode 100644
index 0000000..74e21d5
--- /dev/null
+++ b/shared_php/myAccount.php
@@ -0,0 +1,20 @@
+
Change Password ";
+
+if ($_SESSION['isinstructor'] == 1) {
+ echo "
";
+}
+
+if ($_SESSION['isinstructor'] == 0) {
+
+echo "
";
+}
+if ($_SESSION['isinstructor'] == 0) {
+ echo "
";
+}
+
+include("../shared_php/footer.php");
+?>
diff --git a/shared_php/passChanged.php b/shared_php/passChanged.php
new file mode 100644
index 0000000..f472323
--- /dev/null
+++ b/shared_php/passChanged.php
@@ -0,0 +1,22 @@
+ 0)
+ {
+ echo "Password Changed.\n";
+ }
+ else {echo "Password Was Not Changed.\nCheck your spelling and try again.\n";}
+
+ include("../shared_php/footer.php");
+?>
diff --git a/shared_php/practice.php b/shared_php/practice.php
new file mode 100644
index 0000000..bf5fae7
--- /dev/null
+++ b/shared_php/practice.php
@@ -0,0 +1,192 @@
+logInfo('In Practice page',$_SESSION['uniqueID']);
+?>
+?>
+
+
+
+
+
+
+
+
+
+
+
+ Output:
+
+
+
+
+
+
+
+ Variable
+ Value
+
+
+ y
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/shared_php/saveForm.php b/shared_php/saveForm.php
new file mode 100644
index 0000000..27f7251
--- /dev/null
+++ b/shared_php/saveForm.php
@@ -0,0 +1,49 @@
+"
+ $_SESSION['txtname'] = $y;
+ $x = $_SESSION['txtname'];
+
+ //echo $x;
+}
+
+
+?>
+
+
+
+
+
+
Save Form
+
+
+
+
+
Please, fill the follwing form to save the code:
+
+ file name:
+
+ file extension:
+
+ choose from the list.
+ .cpp
+ .h
+ .py
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/shared_php/saveForm_conf.php b/shared_php/saveForm_conf.php
new file mode 100644
index 0000000..d95438c
--- /dev/null
+++ b/shared_php/saveForm_conf.php
@@ -0,0 +1,68 @@
+Loginfo("in saveForm");
+$x1 = $_SESSION['txtname'];
+
+//echo "$x1
";
+
+$Pname = $_POST['pName'];
+$filext = $_POST['fileExt'];
+$txt1 = $_POST['txt1'];
+
+
+$tab = " ";
+$space= " ";
+$pa = str_replace("", "" , str_replace(" ", $space , str_replace("\t", $tab, $txt1)));
+
+
+if ($filext == '.cpp')
+{
+ $file = $Pname.$filext ;
+
+ file_put_contents($file, $txt1);
+
+ header('Content-Description: File Transfer');
+ header('Content-Type: application/text/x-c++src');
+ header('Content-Disposition: attachment; filename='.basename($file));
+ header('Content-Transfer-Encoding: binary');
+ echo "$txt1";
+
+}
+
+else if ($filext == '.h')
+{
+
+ $file = $Pname.$filext ;
+
+ file_put_contents($file, $txt1);
+
+ header('Content-Description: File Transfer');
+ header('Content-Type: application/text/x-chdr');
+ header('Content-Disposition: attachment; filename='.basename($file));
+
+ echo "$txt1";
+}
+else if ($filext == '.py')
+{
+ $file = $Pname.$filext ;
+
+ file_put_contents($file, $txt1);
+
+ header('Content-Description: File Transfer');
+ header('Content-Type: application/text/x-python');
+ header('Content-Disposition: attachment; filename='.basename($file));
+
+ echo "$txt1";
+
+}
+else
+{
+ echo "";
+ header('Refresh: 2; URL=saveForm.php');
+}
+
+?>
diff --git a/shared_php/session_expired.php b/shared_php/session_expired.php
new file mode 100644
index 0000000..1397a61
--- /dev/null
+++ b/shared_php/session_expired.php
@@ -0,0 +1,10 @@
+
+
+
+";
+
+echo "Oops! Your session has expired! Please
click here or wait to be redirected";
+?>
\ No newline at end of file
diff --git a/shared_php/viewNotif.php b/shared_php/viewNotif.php
new file mode 100644
index 0000000..d33197e
--- /dev/null
+++ b/shared_php/viewNotif.php
@@ -0,0 +1,101 @@
+
+
+
+
+
Notifications ");
+ while($data = mysql_fetch_row($result2)){
+
+ echo "