MSD Purchasing System

2016
MSD Purchasing System
TECHNICAL DOCUMENTATION
Alex Resnick
RIT SENIOR DESIGN DEPARTMENT
CONTENTS
Webserver............................................................................................................................................... 2
Security ................................................................................................................................................... 2
Purchasing System ............................................................................................................................... 2
Web Management utility ..................................................................................................................... 3
Componenets .......................................................................................................................................... 3
Front End............................................................................................................................................. 3
Version Info for the libraries used: ................................................................................................... 3
Back end ............................................................................................................................................. 3
COnfig variables .............................................................................................................................. 4
MYsql database ............................................................................................................................... 5
Automated Emails........................................................................................................................... 5
WEBSERVER
The MSD Purchasing System is hosted on the RIT Production Web Environment
Prod URL: https://www.rit.edu/kgcoe/msdpics/app/home
Staging URL: https://www-staging.rit.edu/kgcoe/msdpics/app/home
Web Management Utility: https://claws.rit.edu/webhosting/
The MySQL Databases are separate for Prod and Staging and are accessed through Web Management
Utility
SECURITY
Both the Purchasing System and the Web Management Utility are secured by RIT’s Shibboleth
Authentication
PURCHASING SYSTEM
Access is controlled by the .htaccess file located in /w-msdpic/www/app/
Only the following account types are permitted: Student, Staff, Faculty
***Affiliate accounts are not permitted as that would enable parents or others to login.
require shib-attr ritEduAccountType Student
require shib-attr ritEduAccountType Faculty
require shib-attr ritEduAccountType Staff
In order to login the user must be registered in an MSD section as a student or instructor:
require shib-attr ritEduStudent ~ .*-MECE-497-.*
require shib-attr ritEduInstructor ~ .*-MECE-497-.*
require shib-attr ritEduStudent ~ .*-MECE-498-.*
require shib-attr ritEduInstructor ~ .*-MECE-498-.*
Access is also granted to employees under the MSD department
***The department attribute has not been added to shibboleth for the site, Clay Cooper has the
information and will add it when able.
require shib-attr ritEduOrganizationDepartment "KGCOE Design, Development & Manufacturing"
Access is granted to any user added to the kgcoe-msd-access group. Chris has the authority to add any
user to the group by submitting a ticket to the ITS Service Desk.
require shib-attr ritEduMemberOfUid ~ .*kgcoe-msd-access.*
WEB MANAGEMENT UTILITY
Access to the Web Management Utility is controlled from within the utility on the Developer Access
page.
COMPONENETS
The Purchasing System is spit into 2 separate pieces; the Front End and the Back End
FRONT END
The Front End is build off of:
AngularJS (https://angularjs.org/)
JQuery (https://jquery.com/)
HTML5 (http://www.w3schools.com/html/)
Twitter Bootstrap (https://getbootstrap.com/)
VERSION INFO FOR THE LIBRARIES USED:
Current as of 4/12/16
AngularJS: 1.5.3 (https://angularjs.org/)
Angular Animate: 1.5.3
Angular Touch: 1.5.3
Angular Sanitize: 1.5.3
JQuery: 2.2.3 ( https://jquery.com/)
Angular UI Router: 0.2.18 (https://github.com/angular-ui/ui-router)
Angular UI Bootstrap: 1.3.1 (https://angular-ui.github.io/bootstrap/)
Angular Chart: 0.9.0 (http://jtblin.github.io/angular-chart.js/)
Angular Loading Bar: 0.9.0 (http://chieffancypants.github.io/angular-loading-bar/)
Angular UI Select: 0.16.1 (https://github.com/angular-ui/ui-select)
Ng Table: 1.0.0-beta.5 (https://github.com/esvit/ng-table)
Angular File Upload: 12.0.4 (https://github.com/danialfarid/ng-file-upload)
Text Angular: 1.5.0 (http://textangular.com/)
Angular Drag and Drop Lists: 1.4.0 (https://github.com/marceljuenemann/angular-drag-and-drop-lists)
These can updated via the references in the <head> tags of the index.html file located in
/w-msdpic/www/app/
BACK END
All back end software is controlled by RIT Web Environment
https://www-staging.rit.edu/kgcoe/msdpics/app/info.php (for info about modules installed, Apache,
PHP…)
All back end code is written in PHP that integrates with MySQL using the mysqli library.
The user logged in (via shibboleth) can be access by the $_SERVER[‘REMOTE_USER’] variable which
will return the username. Other SERVER variables are available and can be found on the info.php page.
Each API Call has its own php file and a common functions library is located in functions.php. All PHP
files are located in the /app/site/ directory.
Database access is generated in the dp.php file. The credentials are stored in the Config Variables.
RIT Directory (LDAP) access uses a service account, kgcoe-msd-svc, in order to perform lookups of
information. The username and password are stored in the Config Variables with the database
credentials.
CONFIG VARIABLES
https://claws.rit.edu/webhosting/configvars.php
The Config Variables are split up between Staging and Production.
The database credentials should not have to change and should not be touched unless absolutely
necessary.
In order to change the adldap credentials, the original value must be deleted and re-added with the new
value.
CHANGE KGCOE-MSD-SVC PASSWORD
To change the password for the service account, delete the adldap_pass value on both staging and
production. Input the Config Variable name (adldap_pass) in the box and the new password value and
click the + button. This must be done on both staging and production, with the same value.
(This will probably have to happen at least 1-2 times per year) You may be able to submit a ticket to the
ITS service desk to make the password permanent and not need to be changed.
MYSQL DATABASE
https://claws.rit.edu/webhosting/database.php
The SQL database is split for Staging and Production. They are 2 completely separate databases and
changes must be made to both.
Backups are taken every night for both sides and can be restored if necessary.
AUTOMATED EMAILS
The function that generates the automated emails is called emailPurchaseRequestNotifications and is
in the functions.php file around line 800. Each type of email is broken up by IF statements and the text
in the body can be changed. The email markup (starts with: <script type="application/ld+json">) is for
the Google Gmail email markup and is not necessary for email functionality, no changes to the email
markup should be necessary. The actual styling and format of the emails is very annoying and any
changes will have to be very methodical as HTML emails are a real pain in the butt.
DEBUGING
Debug on the client side using chrome inspect element and look at the console and network tabs
Debug on the server side by accessing the Apache/PHP logs on the Web Management Utility
https://claws.rit.edu/webhosting/logs.php