A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

server - Stikked
From pgerrish, 10 Years ago, written in Python.
Embed
  1. user_db = dict(johnDoe='myPassword123', charlieTuna='friedFish123')
  2.  
  3. product_db = dict(CBoneBox=dict(), CFace=dict(), CBiped=dict(), CQuadruped=dict())
  4. product_db['CBoneBox']['f673g68tf5g4'] = dict(expiry='01/09/2017', user='JohnDoe')
  5. product_db['CBoneBox']['98j94uf938jd'] = dict(expiry=None, user='CharlieTuna')
  6. product_db['CBiped']['f673g68tf5g4'] = dict(expiry='01/09/2017', user='JohnDoe')
  7.  
  8.  
  9. class User(object):
  10.     def __init__(self, *args, *kwargs):
  11.         #Check if user exists in database
  12.         if not args[0] in user_db:
  13.             raise Exception('User %s does not exist' % args[0])
  14.         self.name = args[0]
  15.         self.password = user_db[self.name]
  16.  
  17.     def authenticate(self, password):
  18.         if password == self.password:
  19.             return True
  20.         else:
  21.             raise Exception('Password does not match records')
  22.  
  23. def authenticateProduct(productName, serial):
  24.     if not productName in product_db:
  25.         raise Exception('Product %s does not exist' % productName)
  26.     if not product_db[productName] == serial:
  27.         raise Exception('Serial number did not match records...')
  28.     return True
  29.  
  30. charlie = User('charlieTuna')
  31.  
  32. try:
  33.     charlie.authenticate('friedFish123')
  34. except Exception,  e:
  35.     print '%s Failed To Login! \n %s' % (charlie.name, e)