+ */
+;(function($, window, document, undefined) {
+ 'use strict';
+
+ // Define plugin name and defaults.
+ var pluginName = 'ufTable',
+ defaults = {
+ DEBUG : false,
+ site : site, // global site variables
+ dataUrl : '',
+ msgTarget : $('#alerts-page'),
+ addParams : {},
+ filterAllField : '_all',
+ useLoadingTransition : true,
+ rowTemplate : null,
+ columnTemplates : {},
+ tablesorter : {
+ debug: false,
+ theme : 'bootstrap',
+ widthFixed: true,
+ // Set up pagination of data via an AJAX source
+ // See http://jsfiddle.net/Mottie/uwZc2/
+ // Also see https://mottie.github.io/tablesorter/docs/example-pager-ajax.html
+ widgets: ['saveSort', 'sort2Hash', 'filter', 'pager', 'columnSelector', 'reflow2'],
+ widgetOptions : {
+ columnSelector_layout : ' {name} ',
+ filter_cssFilter: 'form-control',
+ filter_saveFilters : true,
+ filter_serversideFiltering : true,
+ filter_selectSource : {
+ '.filter-select' : function() { return null; }
+ },
+
+ // apply disabled classname to the pager arrows when the rows at either extreme is visible
+ pager_updateArrows: true,
+
+ // starting page of the pager (zero based index)
+ pager_startPage: 0,
+
+ // Number of visible rows
+ pager_size: 10,
+
+ // Save pager page & size if the storage script is loaded (requires $.tablesorter.storage in jquery.tablesorter.widgets.js)
+ pager_savePages: true,
+
+ // if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty
+ // table row set to a height to compensate; default is false
+ pager_fixedHeight: false,
+
+ // remove rows from the table to speed up the sort of large tables.
+ // setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled.
+ pager_removeRows: false, // removing rows in larger tables speeds up the sort
+
+ // target the pager markup - see the HTML block below
+ pager_css: {
+ errorRow : 'uf-table-error-row', // error information row
+ disabled : 'disabled' // Note there is no period "." in front of this class name
+ },
+
+ // Must be initialized with a 'data' key
+ pager_ajaxObject: {
+ data: {},
+ dataType: 'json'
+ },
+
+ // hash prefix
+ sort2Hash_hash : '#',
+ // don't '#' or '=' here
+ sort2Hash_separator : '|',
+ // this option > table ID > table index on page
+ sort2Hash_tableId : null,
+ // if true, show header cell text instead of a zero-based column index
+ sort2Hash_headerTextAttr : 'data-column-name',
+ // direction text shown in the URL e.g. [ 'asc', 'desc' ]
+ sort2Hash_directionText : [ 'asc', 'desc' ], // default values
+ // if true, override saveSort widget sort, if used & stored sort is available
+ sort2Hash_overrideSaveSort : true, // default = false
+ }
+ }
+ };
+
+ // Constructor
+ function Plugin (element, options) {
+ this.element = element[0];
+ this.$element = $(this.element);
+
+ var lateDefaults = {
+ download: {
+ button: this.$element.find('.js-uf-table-download'),
+ callback: $.proxy(this._onDownload, this)
+ },
+ info: {
+ container: this.$element.find('.js-uf-table-info'),
+ callback: $.proxy(this._renderInfoMessages, this)
+ },
+ overlay: {
+ container: this.$element.find('.js-uf-table-overlay')
+ },
+ tableElement: this.$element.find('.tablesorter'),
+ tablesorter: {
+ widgetOptions: {
+ columnSelector_container : this.$element.find('.js-uf-table-cs-options'),
+ filter_external : this.$element.find('.js-uf-table-search input'),
+
+ // Pager selectors
+ pager_selectors: {
+ container : this.$element.find('.js-uf-table-pager'),
+ first : '.first', // go to first page arrow
+ prev : '.prev', // previous page arrow
+ next : '.next', // next page arrow
+ last : '.last', // go to last page arrow
+ gotoPage : '.gotoPage', // go to page selector - select dropdown that sets the current page
+ pageDisplay : '.pagedisplay', // location of where the "output" is displayed
+ pageSize : '.pagesize' // page size selector - select dropdown that sets the "size" option
+ },
+ // We need to use $.proxy to properly bind the context for callbacks that will be called by Tablesorter
+
+ // Generate the URL for the AJAX request, with the relevant parameters
+ pager_customAjaxUrl: $.proxy(this._generateUrl, this),
+
+ // Callback to process the response from the AJAX request
+ pager_ajaxProcessing: $.proxy(this._processAjax, this),
+
+ // Callback to display errors
+ pager_ajaxError: $.proxy(this._pagerAjaxError, this),
+
+ sort2Hash_encodeHash: $.proxy(this._encodeHash, this),
+
+ sort2Hash_decodeHash: $.proxy(this._decodeHash, this),
+
+ sort2Hash_cleanHash: $.proxy(this._cleanHash, this)
+ }
+ }
+ };
+ this.settings = $.extend(true, {}, defaults, lateDefaults, options);
+ this._defaults = defaults;
+ this._name = pluginName;
+ this._debugAjax = (typeof this.settings.site !== 'undefined') && this.settings.site.debug.ajax;
+
+ // Fall back to attributes from data-*, default values if not specified in options
+ var pagerContainer = this.settings.tablesorter.widgetOptions.pager_selectors.container;
+ var infoContainer = this.settings.info.container;
+ var dataAttributeDefaults = {
+ info: {
+ messageEmptyRows: infoContainer.data('message-empty-rows') ?
+ infoContainer.data('message-empty-rows') :
+ "Sorry, we've got nothing here."
+ },
+ tablesorter: {
+ widgetOptions: {
+ // possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
+ // also {page:input} & {startRow:input} will add a modifiable input in place of the value
+ pager_output: pagerContainer.data('output-template') ?
+ pagerContainer.data('output-template') :
+ '{startRow} to {endRow} of {filteredRows} ({totalRows})' // default if not set on data-* attribute
+ }
+ }
+ };
+
+ this.settings = $.extend(true, {}, dataAttributeDefaults, this.settings);
+
+ // Check that tableElement exists
+ var tableElement = this.settings.tableElement;
+ if (!tableElement.length) {
+ if (window.console && console.error) {
+ console.error('ufTable could not be initialized: wrapper element does not exist, or does not contain a matched tableElement (see https://learn.userfrosting.com/client-side-code/components/tables )');
+ }
+ return;
+ }
+
+ // Copy over dataUrl to pager_ajaxUrl
+ this.settings.tablesorter.widgetOptions.pager_ajaxUrl = this.settings.dataUrl;
+
+ // Set up 'loading' overlays
+ if (this.settings.useLoadingTransition) {
+ var overlay = this.settings.overlay.container;
+ tableElement.bind('sortStart filterStart pageMoved', function() {
+ overlay.removeClass('hidden');
+ }).bind('pagerComplete updateComplete', function() {
+ overlay.addClass('hidden');
+ });
+ }
+
+ // Set up tablesorter and pager
+ this.ts = tableElement.tablesorter(this.settings.tablesorter);
+
+ // Map default column template selectors based on data-column-template attribute in each column header
+ var columns = this.ts[0].config.$headerIndexed;
+ var columnTemplates = {};
+ for (var col = 0; col < columns.length; col++) {
+ var columnName = columns[col].data('column-name');
+ if (!columnName && this.settings.DEBUG) {
+ console.error('Column number ' + col + ' is missing a data-column-name attribute.');
+ }
+ columnTemplates[columnName] = columns[col].data('column-template');
+ }
+
+ // Merge in any column template selectors that were set in the ctor options
+ columnTemplates = $.extend(true, columnTemplates, this.settings.columnTemplates);
+
+ // Locate and compile templates for any string-identified column renderers
+ // At the same time, build out a numerically indexed array of templates
+ this.columnTemplatesIndexed = [];
+ for (var col = 0; col < columns.length; col++) {
+ var columnName = columns[col].data('column-name');
+ if (!columnTemplates[columnName] && this.settings.DEBUG) {
+ console.error("No template found for column '" + columnName + "'.");
+ }
+ var columnTemplate = columnTemplates[columnName];
+ if (typeof columnTemplate === 'string') {
+ this.columnTemplatesIndexed.push(Handlebars.compile($(columnTemplate).html()));
+ } else {
+ this.columnTemplatesIndexed.push(columnTemplate);
+ }
+ }
+
+ // Locate and compile row template
+ this.rowTemplate = Handlebars.compile('');
+ // If rowTemplateSelector is set, then find the DOM element that it references, which contains the template
+ if (this.settings.rowTemplate) {
+ var rowTemplate = this.settings.rowTemplate;
+ if (typeof rowTemplate === 'string') {
+ this.rowTemplate = Handlebars.compile($(this.settings.rowTemplate).html());
+ } else {
+ this.rowTemplate = rowTemplate;
+ }
+ }
+
+ // Link CSV download button
+ this.settings.download.button.on('click', this.settings.download.callback);
+
+ // Allow clicking on the labels in the table menu without closing the menu
+ $(this.settings.tablesorter.widgetOptions.columnSelector_container).find('label').on('click', function(e) {
+ e.stopPropagation();
+ });
+
+ // Propagate our own pagerComplete event
+ this.ts.on('pagerComplete', $.proxy(function () {
+ this.$element.trigger('pagerComplete.ufTable');
+ }, this));
+
+ // Show info messages when there are no rows/no results
+ this.ts.on('filterEnd filterReset pagerComplete', this.settings.info.callback);
+
+ // Detect changes to element attributes
+ this.$element.attrchange({
+ callback: function (event) {
+ this.element = event.target;
+ }.bind(this)
+ });
+
+ return this;
+ }
+
+ /**
+ * Get state variables for this table, as required by the AJAX data source: sorts, filters, size, page
+ */
+ Plugin.prototype.getTableStateVars = function(table) {
+ var base = this;
+
+ // Get sort column and order
+ var sortOrders = {
+ '0': 'asc',
+ '1': 'desc'
+ };
+
+ // Set sorts in URL. Assumes each th has a data-column-name attribute that corresponds to the name in the API
+ var sortList = table.config.sortList;
+ var sorts = {};
+ for (var i = 0; i < sortList.length; i++) {
+ var columnIndex = sortList[i][0];
+ var columnDirection = sortOrders[sortList[i][1]]; // Converts to 'asc' or 'desc'
+ if (sortList[i]) {
+ var columnName = table.config.$headerIndexed[columnIndex].data('column-name');
+ sorts[columnName] = columnDirection;
+ }
+ }
+
+ // Set filters in URL. Assumes each th has a data-column-name attribute that corresponds to the name in the API
+ var filterList = base.getSavedFilters(table);
+ var filters = {};
+ for (i = 0; i < filterList.length; i++) {
+ if (filterList[i]) {
+ var columnName = base.settings.filterAllField;
+
+ if (table.config.$headerIndexed[i]) {
+ columnName = table.config.$headerIndexed[i].data('column-name');
+ }
+
+ filters[columnName] = filterList[i];
+ }
+ }
+
+ var state = {
+ size: table.config.pager.size,
+ page: table.config.pager.page,
+ sorts: sorts,
+ filters: filters
+ };
+
+ return state;
+ };
+
+ /**
+ * Get saved filters from the browser local storage. Those should always be up to date
+ */
+ Plugin.prototype.getSavedFilters = function(table) {
+
+ // Fallback to `getFilters` or empty in case of failure
+ var filterList = $.tablesorter.getFilters(table) || [];
+
+ // Overwrite list with saved filter for filter-select not setup by ts
+ var isArray, saved,
+ wo = table.config.widgetOptions;
+ if ( wo.filter_saveFilters && $.tablesorter.storage ) {
+ saved = $.tablesorter.storage( table, 'tablesorter-filters' ) || [];
+ isArray = $.isArray( saved );
+ // make sure we're not just getting an empty array
+ if ( !( isArray && saved.join( '' ) === '' || !isArray ) ) {
+ filterList = $.tablesorter.filter.processFilters( saved );
+ }
+ }
+
+ return filterList;
+ };
+
+ /**
+ * Generate the AJAX url.
+ * Used as the default callback for pager_customAjaxUrl
+ * @private
+ */
+ Plugin.prototype._generateUrl = function(table, url) {
+ var tableState = this.getTableStateVars(table);
+
+ if (this.settings.DEBUG) {
+ console.log(tableState);
+ }
+
+ $.extend(table.config.pager.ajaxObject.data, tableState);
+
+ // Merge in any additional parameters
+ $.extend(table.config.pager.ajaxObject.data, this.settings.addParams);
+
+ return url;
+ };
+ /**
+ * Process data returned from the AJAX request and rendering the table cells.
+ * Used as the default callback for pager_ajaxProcessing
+ * @private
+ */
+ Plugin.prototype._processAjax = function(data) {
+ var ts = this.ts[0];
+ var json = {},
+ rows = '';
+
+ if (data) {
+ var size = data.rows.length;
+
+ // Render table rows and cells via Handlebars
+ for (var row = 0; row < size; row++) {
+ var cellData = {
+ rownum: row,
+ row : data.rows[row], // It is safe to use the data from the API because Handlebars escapes HTML
+ site : this.settings.site
+ };
+
+ rows += this.rowTemplate(cellData);
+
+ for (var col = 0; col < this.columnTemplatesIndexed.length; col++) {
+ rows += this.columnTemplatesIndexed[col](cellData);
+ }
+
+ rows += ' ';
+ }
+
+ // Initialize any dropdown filters
+ var columns = ts.config.$headerIndexed;
+ this._ajaxInitFilterSelects(columns, data.listable);
+
+ json.total = data.count; // Get total rows without pagination
+ json.filteredRows = data.count_filtered; // no filtering
+ json.rows = $(rows);
+ json.output = data.output;
+ } else {
+ json.total = 0;
+ json.filteredRows = 0;
+ json.rows = '';
+ }
+
+ return json;
+ };
+
+ /**
+ * Initialize filter select menus using the ajax `listable` values
+ * @private
+ */
+ Plugin.prototype._ajaxInitFilterSelects = function(columns, listable) {
+ var ts = this.ts[0];
+ var filters = this.getSavedFilters(ts);
+ // Find columns with `.filter-select` and match them to column numbers based on their data-column-name
+ for (var col = 0; col < columns.length; col++) {
+ var column = columns[col];
+ // If the column is designated for filter-select, get the listables from the data and recreate it
+ if (column.hasClass('filter-select')) {
+ var columnName = column.data('column-name');
+ if (listable[columnName]) {
+ $.tablesorter.filter.buildSelect(ts, col, listable[columnName], true);
+ // If there is a filter actually set for this column, update the selected option.
+ if (filters[col]) {
+ var selectControl = $(ts).find(".tablesorter-filter[data-column='" + col + "']");
+ selectControl.val(filters[col]);
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * Implements handler for the "download CSV" button.
+ * Default callback for download.callback
+ * @private
+ */
+ Plugin.prototype._onDownload = function () {
+ var tableState = this.getTableStateVars(this.ts[0]);
+ tableState.format = 'csv';
+ delete tableState.page;
+ delete tableState.size;
+
+ // Merge in any additional request parameters
+ $.extend(tableState, this.settings.addParams);
+
+ // Causes download to begin
+ window.location = this.settings.dataUrl + '?' + $.param(tableState);
+ };
+
+ /**
+ * Handle pager ajax errors.
+ * @private
+ */
+ Plugin.prototype._pagerAjaxError = function(c, jqXHR, settings, exception) {
+ this._ajaxError(jqXHR);
+
+ // Let TS handle the in-table error message
+ return '';
+ };
+
+ /**
+ * Handle ajax error
+ * @private
+ */
+ Plugin.prototype._ajaxError = function(jqXHR) {
+ if (typeof jqXHR === 'object') {
+ // Error messages
+ if (this._debugAjax && jqXHR.responseText) {
+ document.write(jqXHR.responseText);
+ document.close();
+ } else {
+ if (this.settings.DEBUG) {
+ console.log('Error (' + jqXHR.status + '): ' + jqXHR.responseText );
+ }
+ // Display errors on failure
+ // TODO: ufAlerts widget should have a 'destroy' method
+ if (!this.settings.msgTarget.data('ufAlerts')) {
+ this.settings.msgTarget.ufAlerts();
+ } else {
+ this.settings.msgTarget.ufAlerts('clear');
+ }
+
+ this.settings.msgTarget.ufAlerts('fetch').ufAlerts('render');
+ }
+ }
+ };
+
+ /**
+ * Render info messages, such as when there are no results.
+ * Default callback for info.callback
+ * @private
+ */
+ Plugin.prototype._renderInfoMessages = function () {
+ var table = this.ts[0];
+ var infoMessages = this.settings.info.container;
+ if (table.config.pager) {
+ infoMessages.html('');
+ var fr = table.config.pager.filteredRows;
+ if (fr === 0) {
+ infoMessages.html(this.settings.info.messageEmptyRows);
+ }
+ }
+ };
+
+ /**
+ * Encode the current table state variables into a URL hash.
+ * Default callback for sort2Hash_encodeHash
+ * @private
+ */
+ Plugin.prototype._encodeHash = function(config, tableId, component, value, rawValue) {
+ var wo = config.widgetOptions;
+ if ( component === 'filter' ) {
+ // rawValue is an array of filter values, numerically indexed
+ var encodedFilters = '';
+ var len = rawValue.length;
+ for (var index = 0; index < len; index++) {
+ if (rawValue[index]) {
+ var columnName = this.settings.filterAllField;
+ if (config.$headerIndexed[index]) {
+ columnName = $(config.$headerIndexed[index][0]).attr(wo.sort2Hash_headerTextAttr);
+ }
+ encodedFilters += '&filter[' + tableId + '][' + columnName + ']=' + encodeURIComponent(rawValue[index]);
+ }
+ }
+ return encodedFilters;
+ } else if ( component === 'sort' ) {
+ // rawValue is an array of sort pairs [columnNum, sortDirection]
+ var encodedFilters = '';
+ var len = rawValue.length;
+ for (var index = 0; index < len; index++) {
+ var columnNum = rawValue[index][0];
+ var sortDirection = rawValue[index][1];
+ var columnName = $(config.$headerIndexed[columnNum][0]).attr(wo.sort2Hash_headerTextAttr);
+ encodedFilters += '&sort[' + tableId + '][' + columnName + ']=' + wo.sort2Hash_directionText[sortDirection];
+ }
+ return encodedFilters;
+ }
+ return false;
+ };
+
+ /**
+ * Decode the current table state variables from the URL hash.
+ * Default callback for sort2Hash_decodeHash
+ * @private
+ */
+ Plugin.prototype._decodeHash = function(config, tableId, component) {
+ var wo = config.widgetOptions;
+ var result;
+ // Convert hash into JSON object
+ var urlObject = $.String.deparam(window.location.hash);
+ delete urlObject[wo.sort2Hash_hash]; // Remove hash character
+ if (component === 'filter') {
+ var decodedFilters = [];
+ // Extract filter names and values for the specified table
+ var pageFilters = urlObject.filter ? urlObject.filter : [];
+ if (pageFilters[tableId]) {
+ var tableFilters = pageFilters[tableId];
+ // Build a numerically indexed array of filter values
+ var len = config.$headerIndexed.length;
+ for (var index = 0; index < len; index++) {
+ var columnName = $(config.$headerIndexed[index][0]).attr(wo.sort2Hash_headerTextAttr);
+ if (tableFilters[columnName] && tableFilters[columnName] != this.settings.filterAllField) {
+ decodedFilters.push(tableFilters[columnName]);
+ } else {
+ decodedFilters.push('');
+ }
+ }
+ // Convert array of filter values to a delimited string
+ result = decodedFilters.join(wo.sort2Hash_separator);
+ // make sure to use decodeURIComponent on the result
+ return decodeURIComponent(result);
+ } else {
+ return '';
+ }
+ }
+ return false;
+ };
+
+ /**
+ * Clean up URL hash.
+ * Default callback for sort2Hash_cleanHash
+ * @private
+ */
+ Plugin.prototype._cleanHash = function(config, tableId, component, hash) {
+ var wo = config.widgetOptions;
+ // Convert hash to JSON object
+ var urlObject = $.String.deparam(hash);
+ delete urlObject[wo.sort2Hash_hash]; // Remove hash character
+ // Remove specified component for specified table
+ if (urlObject[component]) {
+ if (urlObject[component][tableId]) {
+ delete urlObject[component][tableId];
+ }
+ // Delete entire component if no other tables remaining
+ if (jQuery.isEmptyObject(urlObject[component])) {
+ delete urlObject[component];
+ }
+ }
+ // Convert modified JSON object back into serialized representation
+ var result = decodeURIComponent(jQuery.param(urlObject));
+ return result.length ? result : '';
+ };
+
+ // Handles instantiation and access to non-private methods.
+ $.fn[pluginName] = function(methodOrOptions) {
+ // Grab plugin instance
+ var instance = $(this).data(pluginName);
+ // If undefined or object, initalise plugin.
+ if (methodOrOptions === undefined || typeof methodOrOptions === 'object') {
+ // Only initalise if not previously done.
+ if (!instance) {
+ $(this).data(pluginName, new Plugin(this, methodOrOptions));
+ }
+ return this;
+ // Otherwise ensure first parameter is a valid string, and is the name of an actual function.
+ } else if (typeof methodOrOptions === 'string' && typeof instance[methodOrOptions] === 'function') {
+ // Ensure not a private function
+ if (methodOrOptions.indexOf('_') !== 0) {
+ return instance[methodOrOptions]( Array.prototype.slice.call(arguments, 1));
+ }
+ else {
+ console.warn( 'Method ' + methodOrOptions + ' is private!' );
+ }
+ } else {
+ console.warn( 'Method ' + methodOrOptions + ' does not exist.' );
+ }
+ };
+})(jQuery, window, document);
diff --git a/login/app/sprinkles/core/assets/userfrosting/js/uf-tablesorter-parsers.js b/login/app/sprinkles/core/assets/userfrosting/js/uf-tablesorter-parsers.js
new file mode 100755
index 0000000..444b4ac
--- /dev/null
+++ b/login/app/sprinkles/core/assets/userfrosting/js/uf-tablesorter-parsers.js
@@ -0,0 +1,53 @@
+// Parser for sorting integers, timestamps, etc based on metadata from attributes
+// Adapted from http://mottie.github.io/tablesorter/docs/example-parsers-advanced.html
+$.tablesorter.addParser({
+ // set a unique id
+ id: 'metanum',
+ is: function(s) {
+ // return false so this parser is not auto detected
+ return false;
+ },
+ format: function(s, table, cell, cellIndex) {
+ var $cell = $(cell);
+ // returns metadata, or cell text (s) if it doesn't exist
+ return $cell.attr('data-num') || s;
+
+ },
+ // set type to numeric
+ type: 'numeric'
+});
+
+$.tablesorter.addParser({
+ // set a unique id
+ id: 'metatext',
+ is: function(s) {
+ // return false so this parser is not auto detected
+ return false;
+ },
+ format: function(s, table, cell, cellIndex) {
+ var $cell = $(cell);
+ // returns metadata, or cell text (s) if it doesn't exist
+ return $cell.attr('data-text') || s;
+
+ },
+
+ type: 'text'
+});
+
+$.tablesorter.addParser({
+ // set a unique id
+ id: 'isblank',
+ is: function(s) {
+ // return false so this parser is not auto detected
+ return false;
+ },
+ format: function(s, table, cell, cellIndex) {
+ var $cell = $(cell);
+ // returns 1 if blank (whitespace), 0 otherwise
+ var isBlank = $cell.html().trim() == " " ? 1 : 0;
+ return isBlank;
+
+ },
+
+ type: 'numeric'
+});
diff --git a/login/app/sprinkles/core/bower.json b/login/app/sprinkles/core/bower.json
new file mode 100755
index 0000000..fb38c72
--- /dev/null
+++ b/login/app/sprinkles/core/bower.json
@@ -0,0 +1,47 @@
+{
+ "name": "userfrosting-sprinkle-core",
+ "description": "Core module for UserFrosting.",
+ "homepage": "https://github.com/userfrosting",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Alexander Weissman",
+ "homepage": "https://alexanderweissman.com"
+ },
+ "ssnukala"
+ ],
+ "dependencies": {
+ "jquery": ">= 2.2.4",
+ "bootstrap": "^3.3.6",
+ "font-awesome": "^4.7",
+ "handlebars": "^3.0",
+ "clipboard": "^1.5",
+ "ionicons": "^2.0",
+ "icheck": "^1.0",
+ "speakingurl": "^11.0",
+ "urijs": "^1.18",
+ "fastclick": "^1.0.6",
+ "moment": "^2.17",
+ "jquery-slimscroll": "^1.3",
+ "jquery-validation": "~1.14.0",
+ "select2": "~4.0.5",
+ "tablesorter": "jquery.tablesorter#2.28"
+ },
+ "resolutions": {
+ "jquery": ">= 2.2.4"
+ },
+ "moduleType": [
+ "node"
+ ],
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "assets/vendor",
+ "examples",
+ "demo-resources",
+ "demo",
+ "test",
+ "tests"
+ ]
+}
diff --git a/login/app/sprinkles/core/composer.json b/login/app/sprinkles/core/composer.json
new file mode 100755
index 0000000..f94c486
--- /dev/null
+++ b/login/app/sprinkles/core/composer.json
@@ -0,0 +1,44 @@
+{
+ "name": "userfrosting/sprinkle-core",
+ "type": "userfrosting-sprinkle",
+ "description": "Core module for UserFrosting.",
+ "keywords": ["php user management", "usercake", "bootstrap"],
+ "homepage": "https://github.com/userfrosting/UserFrosting",
+ "license" : "MIT",
+ "authors" : [
+ {
+ "name": "Alexander Weissman",
+ "homepage": "https://alexanderweissman.com"
+ }
+ ],
+ "require": {
+ "doctrine/dbal": "^2.5",
+ "filp/whoops": "^2.1",
+ "illuminate/cache": "5.4.*",
+ "illuminate/database": "5.4.*",
+ "illuminate/events": "5.4.*",
+ "illuminate/filesystem": "5.4.*",
+ "league/csv": "^8.1",
+ "monolog/monolog": "^1",
+ "phpmailer/phpmailer": "5.2.10",
+ "rockettheme/toolbox": "1.3.1",
+ "slim/csrf": "^0.8",
+ "slim/slim": "^3",
+ "slim/twig-view": "^1.2",
+ "symfony/http-foundation": "*",
+ "twig/twig": "^1.18",
+ "userfrosting/assets": "~4.1.0",
+ "userfrosting/config": "~4.1.0",
+ "userfrosting/cache": "~4.1.0",
+ "userfrosting/fortress": "~4.1.1",
+ "userfrosting/i18n": "~4.1.0",
+ "userfrosting/session": "~4.1.0",
+ "userfrosting/support": "~4.1.1",
+ "vlucas/phpdotenv": "^2"
+ },
+ "autoload": {
+ "psr-4": {
+ "UserFrosting\\Sprinkle\\Core\\": "src/"
+ }
+ }
+}
diff --git a/login/app/sprinkles/core/config/default.php b/login/app/sprinkles/core/config/default.php
new file mode 100755
index 0000000..b6862e6
--- /dev/null
+++ b/login/app/sprinkles/core/config/default.php
@@ -0,0 +1,182 @@
+ [
+ 'admin' => [
+ 'email' => getenv('SMTP_USER') ?: null,
+ 'name' => 'Site Administrator'
+ ]
+ ],
+ 'alert' => [
+ 'storage' => 'session', // Set to one of `cache` or `session`
+ 'key' => 'site.alerts', // the key to use to store flash messages
+ ],
+ 'assets' => [
+ 'compiled' => [
+ 'path' => 'assets',
+ 'schema' => 'bundle.result.json'
+ ],
+ 'raw' => [
+ 'path' => 'assets-raw',
+ 'schema' => 'asset-bundles.json'
+ ],
+ 'use_raw' => true
+ ],
+ 'cache' => [
+ 'driver' => 'file', // Set to one of `file`, `memcached`, `redis`
+ 'prefix' => 'userfrosting', // Edit prefix to something unique when multiple instance of memcached/redis are used on the same server
+ 'memcached' => [
+ 'host' => '127.0.0.1',
+ 'port' => 11211,
+ 'weight' => 100
+ ],
+ 'redis' => [
+ 'host' => '127.0.0.1',
+ 'password' => null,
+ 'port' => 6379,
+ 'database' => 0
+ ],
+ 'twig' => false
+ ],
+ // CSRF middleware settings (see https://github.com/slimphp/Slim-Csrf)
+ 'csrf' => [
+ 'name' => 'csrf',
+ 'storage_limit' => 200,
+ 'strength' => 16,
+ 'persistent_token' => true,
+ // A list of url paths to ignore CSRF checks on
+ 'blacklist' => [
+ // URL paths will be matched against each regular expression in this list.
+ // Each regular expression should map to an array of methods.
+ // Regular expressions will be delimited with ~ in preg_match, so if you
+ // have routes with ~ in them, you must escape this character in your regex.
+ // Also, remember to use ^ when you only want to match the beginning of a URL path!
+ ]
+ ],
+ 'db' => [
+ 'default' => [
+ 'driver' => getenv('DB_DRIVER') ?: 'mysql',
+ 'host' => getenv('DB_HOST') ?: null,
+ 'port' => getenv('DB_PORT') ?: null,
+ 'database' => getenv('DB_NAME') ?: null,
+ 'username' => getenv('DB_USER') ?: null,
+ 'password' => getenv('DB_PASSWORD') ?: null,
+ 'charset' => 'utf8',
+ 'collation' => 'utf8_unicode_ci',
+ 'prefix' => ''
+ ]
+ ],
+ 'debug' => [
+ 'queries' => false,
+ 'smtp' => false,
+ 'twig' => false
+ ],
+ 'mail' => [
+ 'mailer' => 'smtp', // Set to one of 'smtp', 'mail', 'qmail', 'sendmail'
+ 'host' => getenv('SMTP_HOST') ?: null,
+ 'port' => 587,
+ 'auth' => true,
+ 'secure' => 'tls',
+ 'username' => getenv('SMTP_USER') ?: null,
+ 'password' => getenv('SMTP_PASSWORD') ?: null,
+ 'smtp_debug' => 4,
+ 'message_options' => [
+ 'CharSet' => 'UTF-8',
+ 'isHtml' => true,
+ 'Timeout' => 15
+ ]
+ ],
+ // Filesystem paths
+ 'path' => [
+ 'document_root' => str_replace(DIRECTORY_SEPARATOR, \UserFrosting\DS, $_SERVER['DOCUMENT_ROOT']),
+ 'public_relative' => dirname($_SERVER['SCRIPT_NAME']) // The location of `index.php` relative to the document root. Use for sites installed in subdirectories of your web server's document root.
+ ],
+ 'session' => [
+ 'handler' => 'file',
+ // Config values for when using db-based sessions
+ 'database' => [
+ 'table' => 'sessions'
+ ],
+ 'name' => 'uf4',
+ 'minutes' => 120,
+ 'cache_limiter' => false,
+ // Decouples the session keys used to store certain session info
+ 'keys' => [
+ 'csrf' => 'site.csrf', // the key (prefix) used to store an ArrayObject of CSRF tokens.
+ ]
+ ],
+ // Slim settings - see http://www.slimframework.com/docs/objects/application.html#slim-default-settings
+ 'settings' => [
+ 'displayErrorDetails' => true
+ ],
+ // "Site" settings that are automatically passed to Twig
+ 'site' => [
+ 'AdminLTE' => [
+ 'skin' => 'blue'
+ ],
+ 'analytics' => [
+ 'google' => [
+ 'code' => '',
+ 'enabled' => false
+ ]
+ ],
+ 'author' => 'Author',
+ 'csrf' => null, // Do not set this variable. The core Twig extension will override it with values from the CSRF service.
+ 'debug' => [
+ 'ajax' => false,
+ 'info' => true
+ ],
+ 'locales' => [
+ // Should be ordered according to https://en.wikipedia.org/wiki/List_of_languages_by_total_number_of_speakers,
+ // with the exception of English, which as the default language comes first.
+ 'available' => [
+ 'en_US' => 'English',
+ 'zh_CN' => '中文',
+ 'es_ES' => 'Español',
+ 'ar' => 'العربية',
+ 'pt_PT' => 'Português',
+ 'ru_RU' => 'русский',
+ 'de_DE' => 'Deutsch',
+ 'fr_FR' => 'Français',
+ 'tr' => 'Türk',
+ 'it_IT' => 'Italiano',
+ 'th_TH' => 'ภาษาไทย',
+ 'fa' => 'فارسی'
+ ],
+ // This can be a comma-separated list, to load multiple fallback locales
+ 'default' => 'en_US'
+ ],
+ 'title' => 'UserFrosting',
+ // Global ufTable settings
+ 'uf_table' => [
+ 'use_loading_transition' => true
+ ],
+ // URLs
+ 'uri' => [
+ 'base' => [
+ 'host' => isset($_SERVER['SERVER_NAME']) ? trim($_SERVER['SERVER_NAME'], '/') : 'localhost',
+ 'scheme' => empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] === 'off' ? 'http' : 'https',
+ 'port' => isset($_SERVER['SERVER_PORT']) ? (int) $_SERVER['SERVER_PORT'] : null,
+ 'path' => isset($_SERVER['SCRIPT_NAME']) ? trim(dirname($_SERVER['SCRIPT_NAME']), '/\\') : ''
+ ],
+ 'author' => 'https://www.userfrosting.com',
+ 'publisher' => ''
+ ]
+ ],
+ 'php' => [
+ 'timezone' => 'America/New_York',
+ 'error_reporting' => E_ALL, // Development - report all errors and suggestions
+ 'display_errors' => 'true',
+ 'log_errors' => 'false',
+ // Let PHP itself render errors natively. Useful if a fatal error is raised in our custom shutdown handler.
+ 'display_errors_native' => 'false'
+ ]
+ ];
diff --git a/login/app/sprinkles/core/config/dev.php b/login/app/sprinkles/core/config/dev.php
new file mode 100755
index 0000000..daab24c
--- /dev/null
+++ b/login/app/sprinkles/core/config/dev.php
@@ -0,0 +1,30 @@
+ [
+ 'use_raw' => true
+ ],
+ 'cache' => [
+ 'twig' => false
+ ],
+ 'debug' => [
+ 'twig' => true,
+ 'auth' => true,
+ 'smtp' => true
+ ],
+ // Slim settings - see http://www.slimframework.com/docs/objects/application.html#slim-default-settings
+ 'settings' => [
+ 'displayErrorDetails' => true
+ ],
+ 'site' => [
+ 'debug' => [
+ 'ajax' => true,
+ 'info' => true
+ ]
+ ]
+ ];
\ No newline at end of file
diff --git a/login/app/sprinkles/core/config/production.php b/login/app/sprinkles/core/config/production.php
new file mode 100755
index 0000000..d0154d4
--- /dev/null
+++ b/login/app/sprinkles/core/config/production.php
@@ -0,0 +1,40 @@
+ [
+ 'use_raw' => false
+ ],
+ 'cache' => [
+ 'twig' => true
+ ],
+ 'debug' => [
+ 'twig' => false,
+ 'auth' => false,
+ 'smtp' => false
+ ],
+ // Slim settings - see http://www.slimframework.com/docs/objects/application.html#slim-default-settings
+ 'settings' => [
+ 'routerCacheFile' => \UserFrosting\ROOT_DIR . '/' . \UserFrosting\APP_DIR_NAME . '/' . \UserFrosting\CACHE_DIR_NAME . '/' . 'routes.cache',
+ 'displayErrorDetails' => false
+ ],
+ 'site' => [
+ 'analytics' => [
+ 'google' => [
+ 'enabled' => true
+ ]
+ ],
+ 'debug' => [
+ 'ajax' => false,
+ 'info' => false
+ ]
+ ],
+ 'php' => [
+ 'display_errors' => 'false',
+ 'log_errors' => 'true'
+ ]
+ ];
diff --git a/login/app/sprinkles/core/config/testing.php b/login/app/sprinkles/core/config/testing.php
new file mode 100755
index 0000000..7da03c2
--- /dev/null
+++ b/login/app/sprinkles/core/config/testing.php
@@ -0,0 +1,23 @@
+ [
+ 'illuminate' => [
+ 'default' => 'array',
+ ]
+ ],
+ 'db' => [
+ 'test_integration' => [
+ 'driver' => 'sqlite',
+ 'database' => ':memory:',
+ ]
+ ],
+ 'settings' => [
+ 'displayErrorDetails' => false
+ ]
+ ];
diff --git a/login/app/sprinkles/core/extra/adjectives.php b/login/app/sprinkles/core/extra/adjectives.php
new file mode 100755
index 0000000..fbdbeb0
--- /dev/null
+++ b/login/app/sprinkles/core/extra/adjectives.php
@@ -0,0 +1,1221 @@
+ [
+ "@TRANSLATION" => "خطأ",
+
+ "400" => [
+ "TITLE" => "الخطأ 400:اقتراح غير جيد",
+ "DESCRIPTION" => "على الارجح ليس خطأك",
+ ],
+
+ "404" => [
+ "TITLE" => "الخطأ 404: الصفحة غير موجودة",
+ "DESCRIPTION" => " لا يبدو للعثور على ما كنت تبحث عن",
+ "DETAIL" => "حاولنا العثور على صفحتك",
+ "EXPLAIN" => "لم نتمكن من العثور على الصفحة التي تبحث عنها",
+ "RETURN" => 'وفي كلتا الحالتين، اضغط هنا للعودة إلى الصفحة الأولى'
+ ],
+
+ "CONFIG" => [
+ "TITLE" => "مشكلة في تكوين UserFrosting",
+ "DESCRIPTION" => "لم تتحقق بعض متطلبات التكوين UserFrosting",
+ "DETAIL" => "شيء ليس صحيحا هنا",
+ "RETURN" => 'يرجى تصحيح الأخطاء التالية، ثم إعادة تحميل '
+ ],
+
+ "DESCRIPTION" => "لقد لمست اضطراب كبير في الموقع",
+ "DETAIL" => "وهنا ما عندنا من معلومات",
+
+ "ENCOUNTERED" => "حدث شيء لا نعرف ما هو",
+
+ "MAIL" => "خطأ فادح في محاولة البريد الإلكتروني، اتصل بمسؤول المقع إذا كنت المشرف، يرجى التحقق من التسجل البريد الإلكتروني UF",
+
+ "RETURN" => 'اضغط هنا للعودة إلى الصفحة الأولى',
+
+ "SERVER" => "يبدو خادمنا قد أخطأ إذا كنت المسير، يرجى مراجعة سجلات الخطأ PHP أو UF",
+
+ "TITLE" => "اضطراب في الموقع"
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/ar/messages.php b/login/app/sprinkles/core/locale/ar/messages.php
new file mode 100755
index 0000000..e1ee685
--- /dev/null
+++ b/login/app/sprinkles/core/locale/ar/messages.php
@@ -0,0 +1,112 @@
+ 1,
+
+ "ABOUT" => "عن",
+
+ "CAPTCHA" => [
+ "@TRANSLATION" => "كلمة التحقق",
+ "FAIL" => "لم تقم بإدخال رمز كلمة التحقق بشكل صحيح",
+ "SPECIFY" => "أدخل كلمة التحقق",
+ "VERIFY" => "التحقق من كلمة التحقق"
+ ],
+
+ "CSRF_MISSING" => "رمز CSRF غير موجود حاول تحديث الصفحة ومن ثم إرساله مرة أخرى",
+
+ "DB_INVALID" => "لا يمكن الاتصال بقاعدة البيانات إذا كنت مسؤولا، يرجى مراجعة سجل خطأ",
+ "DESCRIPTION" => "وصف",
+ "DOWNLOAD" => [
+ "@TRANSLATION" => "تحميل",
+ "CSV" => "تحميل CSV"
+ ],
+
+ "EMAIL" => [
+ "@TRANSLATION" => "البريد الإلكتروني",
+ "YOUR" => "عنوان بريدك الإلكتروني"
+ ],
+
+ "HOME" => "الصفحة الرئيسية",
+
+ "LEGAL" => [
+ "@TRANSLATION" => "السياسة القانونية",
+ "DESCRIPTION" => "تسري سياستنا القانونية على استخدامك لهذا الموقع وخدماتنا"
+ ],
+
+ "LOCALE" => [
+ "@TRANSLATION" => "اللغه",
+ ],
+
+ "NAME" => "اسم",
+ "NAVIGATION" => "التنقل",
+
+ "PAGINATION" => [
+ "GOTO" => "انتقال إلى الصفحة",
+ "SHOW" => "عرض",
+ "NEXT" => "الصفحة التالية",
+ "PREVIOUS" => "الصفحة السابقة",
+ "FIRST" => "الصفحة الأولى",
+ "LAST" => "آخر صفحة"
+ ],
+ "PRIVACY" => [
+ "@TRANSLATION" => "سياسة الخصوصية",
+ "DESCRIPTION" => "تحدد سياسة الخصوصية لدينا نوع المعلومات التي نجمعها منك وكيفية استخدامها."
+ ],
+
+ "SLUG" => "Slug",
+ "SLUG_CONDITION" => "Slug/الظروف",
+ "STATUS" => "الحالة",
+
+ "UNKNOWN" => "غير معروف",
+
+ // Actions words
+ "ACTIONS" => "الأفعال",
+ "ACTIVATE" => "تفعيل",
+ "ACTIVE" => "نشيط",
+ "ADD" => "إضافة",
+ "CANCEL" => "إلغاء",
+ "CONFIRM" => "تؤكد",
+ "CREATE" => "أنتج",
+ "DELETE" => "حذف",
+ "DELETE_CONFIRM" => "هل أنت متأكد أنك تريد حذف هذا",
+ "DELETE_CONFIRM_YES" => "نعم، احذف",
+ "DELETE_CONFIRM_NAMED" => "هل أنت متأكد أنك تريد حذف {{name}}?",
+ "DELETE_CONFIRM_YES_NAMED" => "نعم، احذف {{name}}",
+ "DELETE_CANNOT_UNDONE" => "لا يمكن التراجع عن هذا الإجراء",
+ "DELETE_NAMED" => "احذف {{name}}",
+ "DENY" => "رفض",
+ "DISABLE" => "تعطيل",
+ "DISABLED" => "معطل",
+ "EDIT" => "تصحيح",
+ "ENABLE" => "تمكين",
+ "ENABLED" => "مكين",
+ "OVERRIDE" => "كتب فوق الكتابة",
+ "RESET" => "إعادة تعيين",
+ "SAVE" => "احفظ",
+ "SEARCH" => "ابحث",
+ "SORT" => "فرز",
+ "SUBMIT" => "ارسل",
+ "PRINT" => "اطباعة",
+ "REMOVE" => "إزالة",
+ "UNACTIVATED" => "إبطال",
+ "UPDATE" => "تحديث",
+ "YES" => "نعم",
+ "NO" => "لا",
+ "OPTIONAL" => "اختياري",
+
+ // Misc
+ "BUILT_WITH_UF" => "بنيت مع UserFrosting ",
+ "ADMINLTE_THEME_BY" => "فكرة رئيسية Almsaeed Studio كل الحقوق محفوظة",
+ "WELCOME_TO" => "مرحبا بك في {{title}}!"
+];
diff --git a/login/app/sprinkles/core/locale/ar/validate.php b/login/app/sprinkles/core/locale/ar/validate.php
new file mode 100755
index 0000000..669a214
--- /dev/null
+++ b/login/app/sprinkles/core/locale/ar/validate.php
@@ -0,0 +1,25 @@
+ [
+ "ARRAY" => "القيمات ل {{label}} يجب أن تكون في مجموعة",
+ "BOOLEAN" => "القيم ل {{label}} يجب أن يكون إما '٠' أو '١'",
+ "INTEGER" => "القيم ل {{label}} يجب أن يكون رقم",
+ "INVALID_EMAIL" => "عنوان البريد الإلكتروني غير صالح",
+ "LENGTH_RANGE" => "{{label}} لابد ان تكون بين {{min}} و {{max}} حورف",
+ "NO_LEAD_WS" => "القيم ل {{label}} لا يمكن أن تبدأ المساحات، علامات، أو بيضاء أخرى",
+ "NO_TRAIL_WS" => "القيم ل {{label}} لا يمكن أن ينتهي مع مسافات، علامات، أو بيضاء أخرى",
+ "REQUIRED" => " تحديد قيمة ل {{label}} "
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/de_DE/errors.php b/login/app/sprinkles/core/locale/de_DE/errors.php
new file mode 100755
index 0000000..cde296b
--- /dev/null
+++ b/login/app/sprinkles/core/locale/de_DE/errors.php
@@ -0,0 +1,53 @@
+ [
+ "@TRANSLATION" => "Fehler",
+
+ "400" => [
+ "TITLE" => "Fehler 400: Ungültige Anforderung",
+ "DESCRIPTION" => "Die Anfrage-Nachricht war fehlerhaft aufgebaut.",
+ ],
+
+ "404" => [
+ "TITLE" => "Fehler 404: Seite nicht gefunden",
+ "DESCRIPTION" => "Die angeforderte Ressource wurde nicht gefunden.",
+ "DETAIL" => "Wir haben versucht Ihre Seite zu finden ...",
+ "EXPLAIN" => "Die von Ihnen gesuchte Seite konnte nicht gefunden werden.",
+ "RETURN" => "Klicken Sie Hier , um zur Startseite zurückzukehren."
+ ],
+
+ "CONFIG" => [
+ "TITLE" => "UserFrosting Konfigurationsproblem!",
+ "DESCRIPTION" => "Einige UserFrosting-Konfigurationsanforderungen wurden nicht erfüllt.",
+ "DETAIL" => "Etwas stimmt hier nicht.",
+ "RETURN" => "Bitte beheben Sie die folgenden Fehler dann laden Sie die Website neu."
+ ],
+
+ "DESCRIPTION" => "Wir haben eine große Störung in der Macht erkannt.",
+ "DETAIL" => "Hier haben wir:",
+
+ "ENCOUNTERED" => "Uhhh ... etwas ist passiert. Wir wissen nicht was.",
+
+ "MAIL" => "Schwerwiegender Fehler beim Mailversand, wenden Sie sich an Ihren Serveradministrator. Wenn Sie der Administrator sind, überprüfen Sie bitte das UF-Mail-Protokoll.",
+
+ "RETURN" => "Klicken Sie Hier , um zur Startseite zurückzukehren.",
+
+ "SERVER" => "Hoppla, sieht aus als hätte der Server möglicherweise gepatzt. Wenn Sie ein Administrator sind, überprüfen Sie bitte die PHP- oder UF-Fehlerprotokolle.",
+
+ "TITLE" => "Störung in der Kraft"
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/de_DE/messages.php b/login/app/sprinkles/core/locale/de_DE/messages.php
new file mode 100755
index 0000000..e254c65
--- /dev/null
+++ b/login/app/sprinkles/core/locale/de_DE/messages.php
@@ -0,0 +1,123 @@
+ 1,
+
+ "ABOUT" => "Über",
+
+ "CAPTCHA" => [
+ "@TRANSLATION" => "Sicherheitscode",
+ "FAIL" => "Sie haben den Sicherheitscode nicht korrekt eingegeben.",
+ "SPECIFY" => "Geben Sie den Sicherheitscode ein",
+ "VERIFY" => "Überprüfen Sie den Sicherheitscode"
+ ],
+
+ "CSRF_MISSING" => "Fehlender CSRF-Token. Versuchen, die Seite zu aktualisieren und erneut zu senden?",
+
+ "DB_INVALID" => "Keine Verbindung zur Datenbank möglich. Wenn Sie ein Administrator sind, überprüfen Sie bitte Ihr Fehlerprotokoll.",
+ "DESCRIPTION" => "Beschreibung",
+ "DOWNLOAD" => [
+ "@TRANSLATION" => "Herunterladen",
+ "CSV" => "CSV herunterladen"
+ ],
+
+ "EMAIL" => [
+ "@TRANSLATION" => "E-Mail",
+ "YOUR" => "Ihre E-Mail-Adresse"
+ ],
+
+ "HOME" => "Startseite",
+
+ "LEGAL" => [
+ "@TRANSLATION" => "Rechtsgrundsatz",
+ "DESCRIPTION" => "Unser Rechtsgrundsatz gilt für die Benutzung dieser Internetseite und unserer Dienste."
+ ],
+
+ "LOCALE" => [
+ "@TRANSLATION" => "Sprache"
+ ],
+
+ "NAME" => "Name",
+ "NAVIGATION" => "Navigation",
+ "NO_RESULTS" => "Sorry, hier gibt es bisher nichts zu sehen.",
+
+ "PAGINATION" => [
+ "GOTO" => "Gehe zu Seite",
+ "SHOW" => "Anzeigen",
+
+ // Paginator
+ // possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
+ // also {page:input} & {startRow:input} will add a modifiable input in place of the value
+ "OUTPUT" => "{startRow} bis {endRow} von {filteredRows} ({totalRows})",
+
+ "NEXT" => "Nächste Seite",
+ "PREVIOUS" => "Vorherige Seite",
+ "FIRST" => "Erste Seite",
+ "LAST" => "Letzte Seite"
+ ],
+ "PRIVACY" => [
+ "@TRANSLATION" => "Datenschutzbestimmungen",
+ "DESCRIPTION" => "In unsere Datenschutzbestimmungen erklären wir Ihnen, welche Daten wir sammeln und wozu wir diese benutzen."
+ ],
+
+ "SLUG" => "Schnecke",
+ "SLUG_CONDITION" => "Schnecke/Bedingungen",
+ "SLUG_IN_USE" => "Die Schnecke {{slug}} existiert bereits",
+ "STATUS" => "Status",
+ "SUGGEST" => "Vorschlagen",
+
+ "UNKNOWN" => "Unbekannt",
+
+ // Actions words
+ "ACTIONS" => "Aktionen",
+ "ACTIVATE" => "Aktivieren",
+ "ACTIVE" => "Aktiv",
+ "ADD" => "Hinzufügen",
+ "CANCEL" => "Abbrechen",
+ "CONFIRM" => "Bestätigen",
+ "CREATE" => "Erstellen",
+ "DELETE" => "Löschen",
+ "DELETE_CONFIRM" => "Möchten Sie diese wirklich löschen?",
+ "DELETE_CONFIRM_YES" => "Ja, löschen",
+ "DELETE_CONFIRM_NAMED" => "Möchten Sie {{name}} wirklich löschen?",
+ "DELETE_CONFIRM_YES_NAMED" => "Ja, {{name}} löschen",
+ "DELETE_CANNOT_UNDONE" => "Diese Aktion kann nicht rückgängig gemacht werden.",
+ "DELETE_NAMED" => "{{name}} löschen",
+ "DENY" => "Verweigern",
+ "DISABLE" => "Deaktivieren",
+ "DISABLED" => "Deaktiviert",
+ "EDIT" => "Bearbeiten",
+ "ENABLE" => "Aktivieren",
+ "ENABLED" => "Aktiviert",
+ "OVERRIDE" => "Überschreiben",
+ "RESET" => "Zurücksetzen",
+ "SAVE" => "Speichern",
+ "SEARCH" => "Suchen",
+ "SORT" => "Sortieren",
+ "SUBMIT" => "Einreichen",
+ "PRINT" => "Drucken",
+ "REMOVE" => "Entfernen",
+ "UNACTIVATED" => "Unaktiviert",
+ "UPDATE" => "Aktualisieren",
+ "YES" => "Ja",
+ "NO" => "Nein",
+ "OPTIONAL" => "Optional",
+
+ // Misc.
+ "BUILT_WITH_UF" => "Errichtet mit UserFrosting ",
+ "ADMINLTE_THEME_BY" => "Theme von Almsaeed Studio . Alle Rechte vorbehalten",
+ "WELCOME_TO" => "Willkommen auf {{title}}!"
+];
diff --git a/login/app/sprinkles/core/locale/de_DE/validate.php b/login/app/sprinkles/core/locale/de_DE/validate.php
new file mode 100755
index 0000000..c10a20a
--- /dev/null
+++ b/login/app/sprinkles/core/locale/de_DE/validate.php
@@ -0,0 +1,32 @@
+ [
+ "ARRAY" => "Die Werte für {{label}} müssen in einem Feld liegen.",
+ "BOOLEAN" => "Der Wert für {{label}} muss entweder '0' oder '1' sein.",
+ "INTEGER" => "Der Wert für {{label}} muss eine ganze Zahl sein.",
+ "INVALID_EMAIL" => "Ungültige E-Mail-Adresse.",
+ "LENGTH_RANGE" => "{{label}} muss zwischen {{min}} und {{max}} Zeichen lang sein.",
+ "NO_LEAD_WS" => "Der Wert für {{label}} kann nicht mit Leerzeichen, Tabulatoren oder anderen Leerzeichen beginnen.",
+ "NO_TRAIL_WS" => "Der Wert für {{label}} kann nicht mit Leerzeichen, Tabulatoren oder anderen Leerzeichen enden.",
+ "REQUIRED" => "Bitte geben Sie einen Wert für {{label}} an.",
+ "SPRUNJE" => [
+ "BAD_FILTER" => "{{name}} ist kein gültiger Filter für dieses Sprunje.",
+ "BAD_LIST" => "{{name}} ist kein gültige Liste für dieses Sprunje.",
+ "BAD_SORT" => "{{name}} ist kein gültiges Sortierungsfeld für dieses Sprunje."
+ ]
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/en_US/errors.php b/login/app/sprinkles/core/locale/en_US/errors.php
new file mode 100755
index 0000000..e868974
--- /dev/null
+++ b/login/app/sprinkles/core/locale/en_US/errors.php
@@ -0,0 +1,51 @@
+ [
+ "@TRANSLATION" => "Error",
+
+ "400" => [
+ "TITLE" => "Error 400: Bad Request",
+ "DESCRIPTION" => "It's probably not your fault.",
+ ],
+
+ "404" => [
+ "TITLE" => "Error 404: Not Found",
+ "DESCRIPTION" => "We can't seem to find what you're looking for.",
+ "DETAIL" => "We tried to find your page...",
+ "EXPLAIN" => "We could not find the page you were looking for.",
+ "RETURN" => 'Either way, click here to return to the front page.'
+ ],
+
+ "CONFIG" => [
+ "TITLE" => "UserFrosting Configuration Issue!",
+ "DESCRIPTION" => "Some UserFrosting configuration requirements have not been met.",
+ "DETAIL" => "Something's not right here.",
+ "RETURN" => 'Please fix the following errors, then reload .'
+ ],
+
+ "DESCRIPTION" => "We've sensed a great disturbance in the Force.",
+ "DETAIL" => "Here's what we got:",
+
+ "ENCOUNTERED" => "Uhhh...something happened. We don't know what.",
+
+ "MAIL" => "Fatal error attempting mail, contact your server administrator. If you are the admin, please check the UserFrosting log.",
+
+ "RETURN" => 'Click here to return to the front page.',
+
+ "SERVER" => "Oops, looks like our server might have goofed. If you're an admin, please check the PHP or UserFrosting logs.",
+
+ "TITLE" => "Disturbance in the Force"
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/en_US/messages.php b/login/app/sprinkles/core/locale/en_US/messages.php
new file mode 100755
index 0000000..40668c8
--- /dev/null
+++ b/login/app/sprinkles/core/locale/en_US/messages.php
@@ -0,0 +1,120 @@
+ 1,
+
+ "ABOUT" => "About",
+
+ "CAPTCHA" => [
+ "@TRANSLATION" => "Captcha",
+ "FAIL" => "You did not enter the captcha code correctly.",
+ "SPECIFY" => "Enter the captcha",
+ "VERIFY" => "Verify the captcha"
+ ],
+
+ "CSRF_MISSING" => "Missing CSRF token. Try refreshing the page and then submitting again?",
+
+ "DB_INVALID" => "Cannot connect to the database. If you are an administrator, please check your error log.",
+ "DESCRIPTION" => "Description",
+ "DOWNLOAD" => [
+ "@TRANSLATION" => "Download",
+ "CSV" => "Download CSV"
+ ],
+
+ "EMAIL" => [
+ "@TRANSLATION" => "Email",
+ "YOUR" => "Your email address"
+ ],
+
+ "HOME" => "Home",
+
+ "LEGAL" => [
+ "@TRANSLATION" => "Legal Policy",
+ "DESCRIPTION" => "Our legal policy applies to your usage of this website and our services."
+ ],
+
+ "LOCALE" => [
+ "@TRANSLATION" => "Locale"
+ ],
+
+ "NAME" => "Name",
+ "NAVIGATION" => "Navigation",
+ "NO_RESULTS" => "Sorry, we've got nothing here.",
+
+ "PAGINATION" => [
+ "GOTO" => "Jump to Page",
+ "SHOW" => "Show",
+
+ // Paginator
+ // possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
+ // also {page:input} & {startRow:input} will add a modifiable input in place of the value
+ "OUTPUT" => "{startRow} to {endRow} of {filteredRows} ({totalRows})",
+ "NEXT" => "Next page",
+ "PREVIOUS" => "Previous page",
+ "FIRST" => "First page",
+ "LAST" => "Last page"
+ ],
+ "PRIVACY" => [
+ "@TRANSLATION" => "Privacy Policy",
+ "DESCRIPTION" => "Our privacy policy outlines what kind of information we collect from you and how we will use it."
+ ],
+
+ "SLUG" => "Slug",
+ "SLUG_CONDITION" => "Slug/Conditions",
+ "SLUG_IN_USE" => "A {{slug}} slug already exists",
+ "STATUS" => "Status",
+ "SUGGEST" => "Suggest",
+
+ "UNKNOWN" => "Unknown",
+
+ // Actions words
+ "ACTIONS" => "Actions",
+ "ACTIVATE" => "Activate",
+ "ACTIVE" => "Active",
+ "ADD" => "Add",
+ "CANCEL" => "Cancel",
+ "CONFIRM" => "Confirm",
+ "CREATE" => "Create",
+ "DELETE" => "Delete",
+ "DELETE_CONFIRM" => "Are you sure you want to delete this?",
+ "DELETE_CONFIRM_YES" => "Yes, delete",
+ "DELETE_CONFIRM_NAMED" => "Are you sure you want to delete {{name}}?",
+ "DELETE_CONFIRM_YES_NAMED" => "Yes, delete {{name}}",
+ "DELETE_CANNOT_UNDONE" => "This action cannot be undone.",
+ "DELETE_NAMED" => "Delete {{name}}",
+ "DENY" => "Deny",
+ "DISABLE" => "Disable",
+ "DISABLED" => "Disabled",
+ "EDIT" => "Edit",
+ "ENABLE" => "Enable",
+ "ENABLED" => "Enabled",
+ "OVERRIDE" => "Override",
+ "RESET" => "Reset",
+ "SAVE" => "Save",
+ "SEARCH" => "Search",
+ "SORT" => "Sort",
+ "SUBMIT" => "Submit",
+ "PRINT" => "Print",
+ "REMOVE" => "Remove",
+ "UNACTIVATED" => "Unactivated",
+ "UPDATE" => "Update",
+ "YES" => "Yes",
+ "NO" => "No",
+ "OPTIONAL" => "Optional",
+
+ // Misc.
+ "BUILT_WITH_UF" => "Built with UserFrosting ",
+ "ADMINLTE_THEME_BY" => "Theme by Almsaeed Studio . All rights reserved",
+ "WELCOME_TO" => "Welcome to {{title}}!"
+];
diff --git a/login/app/sprinkles/core/locale/en_US/validate.php b/login/app/sprinkles/core/locale/en_US/validate.php
new file mode 100755
index 0000000..c4225a2
--- /dev/null
+++ b/login/app/sprinkles/core/locale/en_US/validate.php
@@ -0,0 +1,33 @@
+ [
+ "ARRAY" => "The values for {{label}} must be in an array.",
+ "BOOLEAN" => "The value for {{label}} must be either '0' or '1'.",
+ "INTEGER" => "The value for {{label}} must be an integer.",
+ "INVALID_EMAIL" => "Invalid email address.",
+ "LENGTH_RANGE" => "{{label}} must be between {{min}} and {{max}} characters in length.",
+ "MAX_LENGTH" => "{{label}} must be maximum {{max}} characters in length.",
+ "MIN_LENGTH" => "{{label}} must be minimum {{min}} characters in length.",
+ "NO_LEAD_WS" => "The value for {{label}} cannot begin with spaces, tabs, or other whitespace.",
+ "NO_TRAIL_WS" => "The value for {{label}} cannot end with spaces, tabs, or other whitespace.",
+ "RANGE" => "The value for {{label}} must be between {{min}} and {{max}}.",
+ "REQUIRED" => "Please specify a value for {{label}} .",
+ "SPRUNJE" => [
+ "BAD_FILTER" => "{{name}} is not a valid filter for this Sprunje.",
+ "BAD_LIST" => "{{name}} is not a valid list for this Sprunje.",
+ "BAD_SORT" => "{{name}} is not a valid sort field for this Sprunje."
+ ]
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/es_ES/errors.php b/login/app/sprinkles/core/locale/es_ES/errors.php
new file mode 100755
index 0000000..0e4c671
--- /dev/null
+++ b/login/app/sprinkles/core/locale/es_ES/errors.php
@@ -0,0 +1,51 @@
+ [
+ "@TRANSLATION" => "Error",
+
+ "400" => [
+ "TITLE" => "Error 400: solicitud incorrecta",
+ "DESCRIPTION" => "Probablemente no es tu culpa.",
+ ],
+
+ "404" => [
+ "TITLE" => "Error 404 - Página no encontrada",
+ "DESCRIPTION" => "Parece que no podemos encontrar lo que buscas.",
+ "DETAIL" => "Intentamos encontrar tu página ...",
+ "EXPLAIN" => "No pudimos encontrar la página que buscabas.",
+ "RETURN" => 'De cualquier manera, haga clic en aquí para volver a la página principal.'
+ ],
+
+ "CONFIG" => [
+ "TITLE" => "¡Problema de configuración del Servidor!",
+ "DESCRIPTION" => "Algunos requisitos de configuración de Servidor no se han cumplido.",
+ "DETAIL" => "Algo no está bien aquí.",
+ "RETURN" => 'Corrija los siguientes errores, luego recargue .'
+ ],
+
+ "DESCRIPTION" => "Hemos sentido una gran perturbación en la Fuerza.",
+ "DETAIL" => "Esto es lo que tenemos:",
+
+ "ENCOUNTERED" => "Uhhh ... sucedió algo. No sabemos qué.",
+
+ "MAIL" => "Error fatal al intentar enviar correo, póngase en contacto con el administrador del servidor. Si usted es el administrador, compruebe el log de errores.",
+
+ "RETURN" => 'Haga clic en aquí para volver a la página principal.',
+
+ "SERVER" => "¡Vaya, parece que nuestro servidor pudo haber metido la pata. Si eres un administrador, comprueba los registros de errores de PHP o el log de UserFrosting.",
+
+ "TITLE" => "Perturbación en la Fuerza",
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/es_ES/messages.php b/login/app/sprinkles/core/locale/es_ES/messages.php
new file mode 100755
index 0000000..9bd097a
--- /dev/null
+++ b/login/app/sprinkles/core/locale/es_ES/messages.php
@@ -0,0 +1,115 @@
+ 1,
+
+ "ABOUT" => "Acerca de",
+ "WELCOME_TO" => "¡Bienvenido a {{title}}!",
+
+ "CAPTCHA" => [
+ "@TRANSLATION" => "Captcha",
+ "FAIL" => "No ha introducido correctamente el código de captcha.",
+ "SPECIFY" => "Introduzca el captcha",
+ "VERIFY" => "Verificar el captcha"
+ ],
+
+ "CSRF_MISSING" => "¿Falta el símbolo CSRF?. Intente refrescar la página y luego volver a enviarla",
+
+ "DB_INVALID" => "No se puede conectar a la base de datos. Si es un administrador, compruebe su registro de errores.",
+ "DESCRIPTION" => "Descripción",
+ "DOWNLOAD" => [
+ "@TRANSLATION" => "Descargar",
+ "CSV" => "Descargar CSV"
+ ],
+
+ "EMAIL" => [
+ "@TRANSLATION" => "Email",
+ "YOUR" => "Tu correo electrónico"
+ ],
+
+ "HOME" => "Inicio",
+
+ "LEGAL" => "Política Legal",
+
+ "LOCALE" => [
+ "@TRANSLATION" => "Traducción"
+ ],
+
+ "MAIL_ERROR" => "Error fatal al intentar enviar correo, póngase en contacto con el administrador del servidor. Si eres el administrador, comprueba el registro de correo de UF.",
+
+ "NAME" => "Nombre",
+ "NAVIGATION" => "Navegación",
+
+ "PAGINATION" => [
+ "GOTO" => "Ir a la página",
+ "SHOW" => "Mostrar",
+
+ // Paginator
+ // possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
+ // also {page:input} & {startRow:input} will add a modifiable input in place of the value
+ "OUTPUT" => "{startRow} a {endRow} de {filteredRows} ({totalRows})",
+ "NEXT" => "Siguiente página",
+ "PREVIOUS" => "Pagina anterior",
+ "FIRST" => "Primera página",
+ "LAST" => "Última página"
+ ],
+ "PRIVACY" => "Política de privacidad",
+
+ "SLUG" => "Slug",
+ "SLUG_CONDITION" => "Slug/Condiciones",
+ "SLUG_IN_USE" => "A {{slug}} slug ya existe",
+ "STATUS" => "Estado",
+ "SUGGEST" => "Sugerencia",
+
+ "UNKNOWN" => "Desconocido",
+
+ // Actions words
+ "ACTIONS" => "Acciones",
+ "ACTIVATE" => "Activar",
+ "ACTIVE" => "Activo",
+ "ADD" => "Añadir",
+ "CANCEL" => "Cancelar",
+ "CONFIRM" => "Confirmar",
+ "CREATE" => "Crear",
+ "DELETE" => "Eliminar",
+ "DELETE_CONFIRM" => "¿Estás seguro que quieres eliminar esto?",
+ "DELETE_CONFIRM_YES" => "Sí, borrar",
+ "DELETE_CONFIRM_NAMED" => "¿Seguro que quieres eliminar {{name}}?",
+ "DELETE_CONFIRM_YES_NAMED" => "Sí, eliminar {{nombre}}",
+ "DELETE_CANNOT_UNDONE" => "Esta acción no se puede deshacer.",
+ "DELETE_NAMED" => "Eliminar {{name}}",
+ "DENY" => "Negar",
+ "DISABLE" => "Inhabilitar",
+ "DISABLED" => "Deshabilidato",
+ "EDIT" => "Editar",
+ "ENABLE" => "Habilitar",
+ "ENABLED" => "Habilitado",
+ "OVERRIDE" => "Anular",
+ "RESET" => "Reiniciar",
+ "SAVE" => "Guardar",
+ "SEARCH" => "Buscar",
+ "SORT" => "Ordenar",
+ "SUBMIT" => "Enviar",
+ "PRINT" => "Imprimir",
+ "REMOVE" => "Remover",
+ "UNACTIVATED" => "Desactivado",
+ "UPDATE" => "Actualizar",
+ "YES" => "Si",
+ "NO" => "No",
+ "OPTIONAL" => "Opcional",
+
+ // Misc.
+ "BUILT_WITH_UF" => "Construido con UserFrosting ",
+ "ADMINLTE_THEME_BY" => "Theme by Almsaeed Studio . All rights reserved"
+];
diff --git a/login/app/sprinkles/core/locale/es_ES/validate.php b/login/app/sprinkles/core/locale/es_ES/validate.php
new file mode 100755
index 0000000..38218f5
--- /dev/null
+++ b/login/app/sprinkles/core/locale/es_ES/validate.php
@@ -0,0 +1,35 @@
+ [
+ "ARRAY" => "Los valores de {{label}} deben estar en una matriz.",
+ "BOOLEAN" => "El valor de {{label}} debe ser '0' o '1'.",
+ "INTEGER" => "El valor de {{label}} debe ser un entero.",
+ "NUMERIC" => "El valor de {{label}} debe ser sólo números.",
+ "INVALID_EMAIL" => "Dirección de correo electrónico no válida.",
+ "LENGTH_RANGE" => "{{label}} debe tener entre {{min}} y {{max}} caracteres de longitud.",
+ "MAX_LENGTH" => "{{label}} debe tener un máximo de {{max}} caracteres de longitud.",
+ "MIN_LENGTH" => "{{label}} debe tener un mínimo de {{min}} caracteres de longitud.",
+ "NO_LEAD_WS" => "El valor de {{label}} no puede comenzar con espacios, pestañas u otros espacios en blanco.",
+ "NO_TRAIL_WS" => "El valor de {{label}} no puede finalizar con espacios, pestañas u otros espacios en blanco.",
+ "RANGE" => "El valor de {{label}} debe estar entre {{min}} y {{max}}.",
+ "REQUIRED" => "Especifique un valor para {{label}} .",
+ "PHONE" => "El numero proporcionado para el télefono es invalido.",
+ "SPRUNJE" => [
+ "BAD_FILTER" => " {{name}} no es un filtro válido para este Sprunje.",
+ "BAD_LIST" => " {{name}} no es una lista válida para este Sprunje.",
+ "BAD_SORT" => "{{name}} no es un campo de clasificación válido para este Sprunje."
+ ]
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/fa/errors.php b/login/app/sprinkles/core/locale/fa/errors.php
new file mode 100755
index 0000000..77bfe4f
--- /dev/null
+++ b/login/app/sprinkles/core/locale/fa/errors.php
@@ -0,0 +1,52 @@
+ [
+ "@TRANSLATION" => "خطا",
+
+ "400" => [
+ "TITLE" => "خطا 400: درخواست بد",
+ "DESCRIPTION" => "احتمالا تقصیر شما نیست.",
+ ],
+
+ "404" => [
+ "TITLE" => "خطا 404: صفحه یافت نشد",
+ "DESCRIPTION" => "به نظر نمیرسد چیزی را که دنبالش هستید پیدا کنیم.",
+ "DETAIL" => "ما سعی کردیم صفحه شما را پیدا کنیم...",
+ "EXPLAIN" => "ما نتوانستیم صفحه ی مورد نظر شما را پیدا کنیم.",
+ "RETURN" => 'در هر حال، اینجا کلیک کنید تا به صفحه اصلی بازگردید.'
+ ],
+
+ "CONFIG" => [
+ "TITLE" => "خطای تنظیمات یوزرفروستینگ!",
+ "DESCRIPTION" => "برخی از الزامات پیکربندی یوزرفروستینگ به نتیجه نرسید.",
+ "DETAIL" => "خطایی پیش آمد.",
+ "RETURN" => 'لطفا خطاهای زیر را اصلاح کنید و سپس مجددا بارگذاری نمایید.'
+ ],
+
+ "DESCRIPTION" => "ما یک اختلال بزرگ در سیستم احساس کردیم.",
+ "DETAIL" => "این چیزی است که ما دریافت کردیم",
+
+ "ENCOUNTERED" => "خطایی ویژه. نمیدانیم مشکل چیست.",
+
+ "MAIL" => "خطا در ارسال ایمیل. لطفا با مدیر سیستم تماس برقرار کنید. لطفا لاگ را بررسی کنید.",
+
+ "RETURN" => 'اینجا کلیک تا به صفحه اصلی بازگردید.',
+
+ "SERVER" => "به نظر می آید که در سرور خطایی بوجود آمد. لطفا لاگ پی اچ پی و یوزرفروستینگ را چک کنید.",
+
+ "TITLE" => "اختلالی پدید آمد."
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/fa/messages.php b/login/app/sprinkles/core/locale/fa/messages.php
new file mode 100755
index 0000000..00611c5
--- /dev/null
+++ b/login/app/sprinkles/core/locale/fa/messages.php
@@ -0,0 +1,110 @@
+ 1,
+
+ "ABOUT" => "درباره",
+
+ "CAPTCHA" => [
+ "@TRANSLATION" => "کد امنیتی",
+ "FAIL" => "کد امنیتی درست نیست",
+ "SPECIFY" => "کد امنیتی را وارد کنید",
+ "VERIFY" => "کد امنیتی را بررسی کنید"
+ ],
+
+ "CSRF_MISSING" => "سی اس آر اف توکن یافت نشد. لطفا صفحه را از نو بارگذاری کرده و دوباره تلاش کنید.",
+
+ "DB_INVALID" => "خطا در اتصال به پایگاه داده ها. لطفا لاگ پی اچ پی را چک کنید.",
+ "DESCRIPTION" => "توضیحات",
+ "DOWNLOAD" => [
+ "@TRANSLATION" => "دانلود",
+ "CSV" => "دانلود سی اس وی"
+ ],
+
+ "EMAIL" => [
+ "@TRANSLATION" => "ایمیل",
+ "YOUR" => "آدرس ایمیل"
+ ],
+
+ "HOME" => "خانه",
+
+ "LEGAL" => "سیاست حقوقی",
+
+ "LOCALE" => [
+ "@TRANSLATION" => "زبان"
+ ],
+
+ "NAME" => "نام",
+ "NAVIGATION" => "جهت یابی",
+ "NO_RESULTS" => "با عرض پوزش، چیزی یافت نشد.",
+
+ "PAGINATION" => [
+ "GOTO" => "پرش به صفحه",
+ "SHOW" => "نمایش",
+
+ // Paginator
+ // possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
+ // also {page:input} & {startRow:input} will add a modifiable input in place of the value
+ "OUTPUT" => "{startRow} تا {endRow} از {filteredRows} ({totalRows})"
+ ],
+ "PRIVACY" => "سیاست حفظ حریم خصوصی",
+
+ "SLUG" => "اسلاگ",
+ "SLUG_CONDITION" => "اسلاگ/شرایط",
+ "SLUG_IN_USE" => "{{slug}} وجود دارد",
+ "STATUS" => "وضعیت",
+ "SUGGEST" => "پیشنهاد",
+
+ "UNKNOWN" => "ناشناخته",
+
+ // Actions words
+ "ACTIONS" => "اقدام ها",
+ "ACTIVATE" => "فعال سازی",
+ "ACTIVE" => "فعال",
+ "ADD" => "اضافه کردن",
+ "CANCEL" => "لغو",
+ "CONFIRM" => "تایید",
+ "CREATE" => "اضافه کردن",
+ "DELETE" => "حذف",
+ "DELETE_CONFIRM" => "آیا مطمئن هستید که میخواهید این را حذف کنید؟",
+ "DELETE_CONFIRM_YES" => "بله، حذف شود",
+ "DELETE_CONFIRM_NAMED" => "اطمینان دارید که میخواهید {{name}} را حذف کنید؟",
+ "DELETE_CONFIRM_YES_NAMED" => "بله، {{name}} حذف شود",
+ "DELETE_CANNOT_UNDONE" => "این عملیات قابل بازگشت نیست.",
+ "DELETE_NAMED" => "{{name}} حذف شود",
+ "DENY" => "انکار",
+ "DISABLE" => "غیر فعال",
+ "DISABLED" => "غیر فعال",
+ "EDIT" => "ویرایش",
+ "ENABLE" => "فعال",
+ "ENABLED" => "فعال",
+ "OVERRIDE" => "تغییر",
+ "RESET" => "تنظیم مجدد",
+ "SAVE" => "ذخیره",
+ "SEARCH" => "جست و جو",
+ "SORT" => "مرتب سازی",
+ "SUBMIT" => "ارسال",
+ "PRINT" => "چاپ",
+ "REMOVE" => "حذف",
+ "UNACTIVATED" => "غیر فعال",
+ "UPDATE" => "به روز رسانی",
+ "YES" => "بله",
+ "NO" => "خیر",
+ "OPTIONAL" => "اختیاری",
+
+ // Misc.
+ "BUILT_WITH_UF" => "ساخته شده با یوزرفراستینگ ",
+ "ADMINLTE_THEME_BY" => "قالب از Almsaeed Studio . تمامی حقوق محفوظ است"
+];
diff --git a/login/app/sprinkles/core/locale/fa/validate.php b/login/app/sprinkles/core/locale/fa/validate.php
new file mode 100755
index 0000000..db364b1
--- /dev/null
+++ b/login/app/sprinkles/core/locale/fa/validate.php
@@ -0,0 +1,31 @@
+ [
+ "ARRAY" => "مقادیر {{label}} باید از یک آرایه باشند.",
+ "BOOLEAN" => "مقدار {{label}} باید 1 یا 0 باشد.",
+ "INTEGER" => "مقدار {{label}} باید یک عدد اینتجر باشد.",
+ "INVALID_EMAIL" => "آدرس پست الکترونیکی صحیح نیست.",
+ "LENGTH_RANGE" => "{{label}} باید بین {{min}} و {{max}} حرف باشد.",
+ "NO_LEAD_WS" => "مقدار {{label}} نباید با فاصله شروع شود.",
+ "NO_TRAIL_WS" => "مقدار {{label}} نباید با فاصله تمام شود.",
+ "REQUIRED" => "لطفا برای {{label}} مقداری تعیین کنید.",
+ "SPRUNJE" => [
+ "BAD_FILTER" => "{{name}} فیلتر صحیحی نیست.",
+ "BAD_LIST" => "{{name}} لیست صحیحی نیست.",
+ "BAD_SORT" => "{{name}} فیلد مرتب سازی صحیحی نیست."
+ ]
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/fr_FR/errors.php b/login/app/sprinkles/core/locale/fr_FR/errors.php
new file mode 100755
index 0000000..570a676
--- /dev/null
+++ b/login/app/sprinkles/core/locale/fr_FR/errors.php
@@ -0,0 +1,51 @@
+ [
+ "@TRANSLATION" => "Erreur",
+
+ "400" => [
+ "TITLE" => "Erreur 400: Mauvaise requête",
+ "DESCRIPTION" => "Ce n'est probablement pas de votre faute.",
+ ],
+
+ "404" => [
+ "TITLE" => "Erreur 404: Page introuvable",
+ "DESCRIPTION" => "Nous ne pouvons trouver ce que vous cherchez.",
+ "DETAIL" => "Nous avons tout tenté...",
+ "EXPLAIN" => "Nous ne pouvons trouver la page que vous cherchez.",
+ "RETURN" => 'Cliquez ici pour retourner à la page d\'accueil.'
+ ],
+
+ "CONFIG" => [
+ "TITLE" => "Problème de configuration UserFrosting!",
+ "DESCRIPTION" => "Les exigences de configuration de UserFrosting n'ont pas été satisfaites.",
+ "DETAIL" => "Quelque chose cloche ici...",
+ "RETURN" => 'Corrigez les erreurs suivantes, ensuite recharger la page .'
+ ],
+
+ "DESCRIPTION" => "Nous avons ressenti un grand bouleversement de la Force.",
+ "DETAIL" => "Voici les détails :",
+
+ "ENCOUNTERED" => "D'oh! Quelque chose s'est produit. Aucune idée c'est quoi.",
+
+ "MAIL" => "Erreur fatale lors de l'envoie du courriel. Contactez votre administrateur. Si vous être administrateur, consultez les logs.",
+
+ "RETURN" => 'Cliquez ici pour retourner à la page d\'accueil.',
+
+ "SERVER" => "Oops, il semblerait que le serveur a gaffé. Si vous êtes administrateur, s-v-p vérifier les logs d'erreurs PHP ou ceux de UserFrosting.",
+
+ "TITLE" => "Bouleversement de la Force"
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/fr_FR/messages.php b/login/app/sprinkles/core/locale/fr_FR/messages.php
new file mode 100755
index 0000000..c053569
--- /dev/null
+++ b/login/app/sprinkles/core/locale/fr_FR/messages.php
@@ -0,0 +1,105 @@
+ 2,
+
+ "ABOUT" => "À propos",
+
+ "CAPTCHA" => [
+ "@TRANSLATE" => "Captcha",
+ "VERIFY" => "Vérification du captcha",
+ "SPECIFY" => "Entrer la valeur du captcha",
+ "FAIL" => "La valeur du captcha n'a pas été entrée correctement."
+ ],
+
+ "CSRF_MISSING" => "Jeton CSRF manquant. Essayez de rafraîchir la page et de soumettre de nouveau?",
+
+ "DB_INVALID" => "Impossible de se connecter à la base de données. Si vous êtes un administrateur, vérifiez votre journal d'erreurs.",
+ "DESCRIPTION" => "Description",
+ "DOWNLOAD" => [
+ "@TRANSLATION" => "Télécharger",
+ "CSV" => "Télécharger CSV"
+ ],
+
+ "EMAIL" => [
+ "@TRANSLATION" => "Email",
+ "YOUR" => "Votre adresse email"
+ ],
+
+ "HOME" => "Accueil",
+
+ "LEGAL" => "Politique légale",
+
+ "LOCALE" => [
+ "@TRANSLATION" => "Langue"
+ ],
+
+ "NAME" => "Nom",
+ "NAVIGATION" => "Menu principal",
+ "NO_RESULTS" => "Aucun résultat trouvé.",
+
+ "PAGINATION" => [
+ "GOTO" => "Aller à la page",
+ "SHOW" => "Afficher",
+ "OUTPUT" => "{startRow} à {endRow} de {filteredRows} ({totalRows})"
+ ],
+ "PRIVACY" => "Politique de confidentialité",
+
+ "SLUG" => "Jeton",
+ "SLUG_CONDITION" => "Jeton/Conditions",
+ "SLUG_IN_USE" => "Un jeton {{slug}} existe déjà",
+ "STATUS" => "Statut",
+ "SUGGEST" => "Suggérer",
+
+ "UNKNOWN" => "Inconnu",
+
+ // Actions words
+ "ACTIONS" => "Actions",
+ "ACTIVATE" => "Autoriser",
+ "ACTIVE" => "Activé",
+ "ADD" => "Ajouter",
+ "CANCEL" => "Annuler",
+ "CONFIRM" => "Confirmer",
+ "CREATE" => "Créer",
+ "DELETE" => "Supprimer",
+ "DELETE_CONFIRM" => "Êtes-vous sûr de vouloir supprimer ceci?",
+ "DELETE_CONFIRM_YES" => "Oui, supprimer",
+ "DELETE_CONFIRM_NAMED" => "Êtes-vous sûr de vouloir supprimer {{name}}?",
+ "DELETE_CONFIRM_YES_NAMED" => "Oui, supprimer {{name}}",
+ "DELETE_CANNOT_UNDONE" => "Cette action ne peut être annulée.", //This action cannot be undone
+ "DELETE_NAMED" => "Supprimer {{name}}",
+ "DENY" => "Refuser",
+ "DISABLE" => "Désactiver",
+ "DISABLED" => "Désactivé",
+ "EDIT" => "Modifier",
+ "ENABLE" => "Activer",
+ "ENABLED" => "Activé",
+ "OVERRIDE" => "Forcer",
+ "RESET" => "Réinitialiser",
+ "SAVE" => "Sauvegarder",
+ "SEARCH" => "Rechercher",
+ "SORT" => "Trier",
+ "SUBMIT" => "Envoyer",
+ "PRINT" => "Imprimer",
+ "REMOVE" => "Supprimer",
+ "UNACTIVATED" => "Non activé",
+ "UPDATE" => "Mettre à jour",
+ "YES" => "Oui",
+ "NO" => "Non",
+ "OPTIONAL" => "Facultatif",
+
+ // Misc.
+ "BUILT_WITH_UF" => "Créé avec UserFrosting ",
+ "ADMINLTE_THEME_BY" => "Thème par Almsaeed Studio . Tous droits réservés"
+];
\ No newline at end of file
diff --git a/login/app/sprinkles/core/locale/fr_FR/validate.php b/login/app/sprinkles/core/locale/fr_FR/validate.php
new file mode 100755
index 0000000..ea85677
--- /dev/null
+++ b/login/app/sprinkles/core/locale/fr_FR/validate.php
@@ -0,0 +1,33 @@
+ [
+ "ARRAY" => "Les valeurs de {{label}} doivent être dans un tableau.",
+ "BOOLEAN" => "La valeur de {{label}} doit être '0' ou '1'.",
+ "INTEGER" => "La valeur de {{label}} doit être un nombre entier.",
+ "INVALID_EMAIL" => "Addresse email invalide.",
+ "LENGTH_RANGE" => "La valeur de {{label}} doit faire entre {{min}} et {{max}} caractères.",
+ "MAX_LENGTH" => "La valeur de {{label}} doit être d'un maximum de {{max}} caractères.",
+ "MIN_LENGTH" => "La valeur de {{label}} doit être d'un minimum de {{min}} caractères.",
+ "NO_LEAD_WS" => "La valeur de {{label}} ne peut pas commencer par des espaces, des tabulations ou d'autres caractères invisibles",
+ "NO_TRAIL_WS" => "La valeur de {{label}} ne peut pas se terminer par des espaces, des tabulations ou d'autres caractères invisibles",
+ "RANGE" => "Le champ {{label}} doit être une valeur entre {{min}} et {{max}}.",
+ "REQUIRED" => "Le champ {{label}} doit être rempli.",
+ "SPRUNJE" => [
+ "BAD_FILTER" => "{{name}} ne peut pas être utilisé pour filtrer ce Sprunje.",
+ "BAD_LIST" => "{{name}} is not a valid list for this Sprunje.",
+ "BAD_SORT" => "{{name}} ne peut pas être utilisé pour trier Sprunje."
+ ]
+ ]
+];
\ No newline at end of file
diff --git a/login/app/sprinkles/core/locale/it_IT/errors.php b/login/app/sprinkles/core/locale/it_IT/errors.php
new file mode 100755
index 0000000..c5d4eaa
--- /dev/null
+++ b/login/app/sprinkles/core/locale/it_IT/errors.php
@@ -0,0 +1,53 @@
+ [
+ "@TRANSLATION" => "Errore",
+
+ "400" => [
+ "TITLE" => "Errore 400: Cattiva Richiesta",
+ "DESCRIPTION" => "Scusa per l'errore.",
+ ],
+
+ "404" => [
+ "TITLE" => "Errore 404 - Pagina Non Trovata",
+ "DESCRIPTION" => "Non possiamo sembrare trovare quello che stai cercando.",
+ "DETAIL" => "Abbiamo cercato di trovare la tua pagina ...",
+ "EXPLAIN" => "Non abbiamo trovato la pagina che stavi cercando.",
+ "RETURN" => "Fai clic su qui per tornare alla prima pagina."
+ ],
+
+ "CONFIG" => [
+ "TITLE" => "Problema di configurazione di UserFrosting!",
+ "DESCRIPTION" => "Alcuni requisiti di configurazione UserFrosting non sono stati soddisfatti.",
+ "DETAIL" => "Qualcosa non è proprio qui.",
+ "RETURN" => "Correggi i seguenti errori, quindi ricarica ."
+ ],
+
+ "DESCRIPTION" => "Abbiamo sentito un grande disturbo nella Forza.",
+ "DETAIL" => "Ecco quello che sappiamo:",
+
+ "ENCOUNTERED" => "Uhhh...qualcosa è accaduto. Non sappiamo cosa.",
+
+ "MAIL" => "Errore nell'invio della mail, contatta l'amministratore di sistema",
+
+ "RETURN" => "Fai clic su qui per tornare alla prima pagina.",
+
+ "SERVER" => "Sembra esserci un errore nel server. Se sei un admin, controlla i log di PHP o UserFrosting.",
+
+ "TITLE" => "Disturbo nella Forza"
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/it_IT/messages.php b/login/app/sprinkles/core/locale/it_IT/messages.php
new file mode 100755
index 0000000..255d732
--- /dev/null
+++ b/login/app/sprinkles/core/locale/it_IT/messages.php
@@ -0,0 +1,123 @@
+ 1,
+
+ "ABOUT" => "Riguardo a noi",
+
+ "CAPTCHA" => [
+ "@TRANSLATION" => "Captcha",
+ "FAIL" => "Domanda di sicurezza sbagliata",
+ "SPECIFY" => "Inserire il captcha",
+ "VERIFY" => "Verifica la captcha"
+ ],
+
+ "CSRF_MISSING" => "Sigillo CSRF mancante. Prova a aggiornare la pagina e poi di inviarlo nuovamente?",
+
+ "DB_INVALID" => "Impossibile connettersi al database. Se sei un amministratore, controlla il registro PHP o UserFrosting.",
+ "DESCRIPTION" => "Descrizione",
+ "DOWNLOAD" => [
+ "@TRANSLATION" => "Scaricare",
+ "CSV" => "Scarica CSV"
+ ],
+
+ "EMAIL" => [
+ "@TRANSLATION" => "E-mail",
+ "YOUR" => "La tua email"
+ ],
+
+ "HOME" => "Inizio",
+
+ "LEGAL" => [
+ "@TRANSLATION" => "Politica Legale",
+ "DESCRIPTION" => "La nostra politica legale si applica al tuo utilizzo di questo sito e dei nostri servizi."
+ ],
+
+ "LOCALE" => [
+ "@TRANSLATION" => "Località"
+ ],
+
+ "NAME" => "Nome",
+ "NAVIGATION" => "Navigazione",
+ "NO_RESULTS" => "Spiacenti, non abbiamo niente qui.",
+
+ "PAGINATION" => [
+ "GOTO" => "Vai alla pagina",
+ "SHOW" => "Mostrare",
+
+ // Paginator
+ // possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
+ // also {page:input} & {startRow:input} will add a modifiable input in place of the value
+ "OUTPUT" => "{startRow} a {endRow} di {filteredRows} ({totalRows})",
+ "NEXT" => "Pagina successiva",
+ "PREVIOUS" => "Pagina precedente",
+ "FIRST" => "Prima pagina",
+ "LAST" => "Ultima pagina"
+ ],
+ "PRIVACY" => [
+ "@TRANSLATION" => "Politica sulla riservatezza",
+ "DESCRIPTION" => "La nostra politica sulla privacy descrive quali tipi di informazioni raccoglieremo da te e come lo useremo."
+ ],
+
+ "SLUG" => "Slug",
+ "SLUG_CONDITION" => "Slug/Condizioni",
+ "SLUG_IN_USE" => "Esiste già uno slug {{slug}} ",
+ "STATUS" => "Stato",
+ "SUGGEST" => "Suggerire",
+
+ "UNKNOWN" => "Sconosciuto",
+
+ // Actions words
+ "ACTIONS" => "Azioni",
+ "ACTIVATE" => "Attivare",
+ "ACTIVE" => "Attivo",
+ "ADD" => "Aggiungere",
+ "CANCEL" => "Annulla",
+ "CONFIRM" => "Conferma",
+ "CREATE" => "Creare",
+ "DELETE" => "Elimina",
+ "DELETE_CONFIRM" => "Sei sicuro di voler cancellare questo?",
+ "DELETE_CONFIRM_YES" => "Sì, elimini",
+ "DELETE_CONFIRM_NAMED" => "Sei sicuro di voler eliminare {{name}}?",
+ "DELETE_CONFIRM_YES_NAMED" => "Sì, eliminare {{name}}",
+ "DELETE_CANNOT_UNDONE" => "Questa azione non può essere annullata.",
+ "DELETE_NAMED" => "Elimina {{name}}",
+ "DENY" => "Nega",
+ "DISABLE" => "Disattivare",
+ "DISABLED" => "Disabilitato",
+ "EDIT" => "Modifica",
+ "ENABLE" => "Abilitare",
+ "ENABLED" => "Abilitato",
+ "OVERRIDE" => "Alterare",
+ "RESET" => "Azzerare",
+ "SAVE" => "Memorizzare",
+ "SEARCH" => "Cercare",
+ "SORT" => "Ordinare",
+ "SUBMIT" => "Inviare",
+ "SUCCESS" => "Successo",
+ "PRINT" => "Stampare",
+ "REMOVE" => "Rimuovere",
+ "UNACTIVATED" => "Non attivato",
+ "UPDATE" => "Aggiornare",
+ "YES" => "Sì",
+ "NO" => "No",
+ "OPTIONAL" => "Opzionale",
+
+ // Misc.
+ "BUILT_WITH_UF" => "Construito UserFrosting ",
+ "ADMINLTE_THEME_BY" => "Tema da Almsaeed Studio . Tutti i diritti riservati",
+ "WELCOME_TO" => "Benvenuto a {{title}}!"
+];
diff --git a/login/app/sprinkles/core/locale/it_IT/validate.php b/login/app/sprinkles/core/locale/it_IT/validate.php
new file mode 100755
index 0000000..99e4a57
--- /dev/null
+++ b/login/app/sprinkles/core/locale/it_IT/validate.php
@@ -0,0 +1,32 @@
+ [
+ "ARRAY" => "I valori per {{label}} devono essere in un vettore.",
+ "BOOLEAN" => "Il valore per {{label}} deve essere '0' o '1'.",
+ "INTEGER" => "Il valore per {{label}} deve essere un intero.",
+ "INVALID_EMAIL" => "Indirizzo mail non valido",
+ "LENGTH_RANGE" => "{{label}} deve essere compreso tra i caratteri {{min}} e {{max}} in lunghezza.",
+ "NO_LEAD_WS" => "Il valore di {{label}} non può iniziare con spazi, tabulazioni o altri spazi vuoti.",
+ "NO_TRAIL_WS" => "Il valore di {{label}} non può terminare con spazi, tabulazioni o altri spazi vuoti.",
+ "REQUIRED" => "Il campo {{label}} deve essere specificato.",
+ "SPRUNJE" => [
+ "BAD_FILTER" => "{{name}} non è un filtro valido per questo Sprunje.",
+ "BAD_LIST" => " {{name}} non è un elenco valido per questo Sprunje.",
+ "BAD_SORT" => "{{name}} non è un campo di ordinamento valido per questo Sprunje."
+ ]
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/pt_PT/errors.php b/login/app/sprinkles/core/locale/pt_PT/errors.php
new file mode 100755
index 0000000..2c938ec
--- /dev/null
+++ b/login/app/sprinkles/core/locale/pt_PT/errors.php
@@ -0,0 +1,51 @@
+ [
+ "@TRANSLATION" => "Erro",
+
+ "400" => [
+ "TITLE" => "Erro 400: Pedido Inválido",
+ "DESCRIPTION" => "Provavelmente a culpa não é sua.",
+ ],
+
+ "404" => [
+ "TITLE" => "Erro 404: Página não Encontrada",
+ "DESCRIPTION" => "Parece que não conseguimos encontrar a página que procura.",
+ "DETAIL" => "Tentámos encontrar a sua página...",
+ "EXPLAIN" => "Não conseguimos encontrar a página que procura.",
+ "RETURN" => 'De qualquer forma, clique aqui para regressar à página inicial.'
+ ],
+
+ "CONFIG" => [
+ "TITLE" => "Problema de Configuração do UserFrosting!",
+ "DESCRIPTION" => "Alguns requisitos de configuração do UserFrosting não foram satisfeitos.",
+ "DETAIL" => "Algo não está bem.",
+ "RETURN" => 'Por favor corrija os seguintes erros, depois refresque a página.'
+ ],
+
+ "DESCRIPTION" => "Sentimos uma grande perturbância na Força.",
+ "DETAIL" => "Eis o que sabemos:",
+
+ "ENCOUNTERED" => "Uhhh...algo aconteceu. Não sabemos bem o quê.",
+
+ "MAIL" => "Erro fatal ao tentar enviar email, contate o administrator do servidor. Se é administrador, por favor consulte o log de mail do UF.",
+
+ "RETURN" => 'Clique aqui para regressar à página inicial.',
+
+ "SERVER" => "Oops, parece que o nosso servidor deu o berro. Se é um administrador, por favor consulte o log de erros PHP ou UF.",
+
+ "TITLE" => "Perturbância na Força"
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/pt_PT/messages.php b/login/app/sprinkles/core/locale/pt_PT/messages.php
new file mode 100755
index 0000000..a97704c
--- /dev/null
+++ b/login/app/sprinkles/core/locale/pt_PT/messages.php
@@ -0,0 +1,102 @@
+ 1,
+
+ "ABOUT" => "Acerca",
+
+ "CAPTCHA" => [
+ "@TRANSLATION" => "Captcha",
+ "FAIL" => "Código captcha não introduzido corretamente.",
+ "SPECIFY" => "Introduza o código captcha",
+ "VERIFY" => "Verifique o código captcha"
+ ],
+
+ "CSRF_MISSING" => "Token CSRF em falta. Tente refrescar a página e submeter de novo?",
+
+ "DB_INVALID" => "Não é possível estabelecer ligação com a base de dados. Se é administrador, por favor consulte o log do servidor.",
+ "DESCRIPTION" => "Descrição",
+ "DOWNLOAD" => [
+ "@TRANSLATION" => "Descarregar",
+ "CSV" => "Descarregar CSV"
+ ],
+
+ "EMAIL" => [
+ "@TRANSLATION" => "Email",
+ "YOUR" => "O seu endereço de email"
+ ],
+
+ "HOME" => "Início",
+
+ "LEGAL" => "Política Legal",
+
+ "LOCALE" => [
+ "@TRANSLATION" => "Localização"
+ ],
+
+ "NAME" => "Nome",
+ "NAVIGATION" => "Navegação",
+
+ "PAGINATION" => [
+ "GOTO" => "Saltar para Página",
+ "SHOW" => "Mostrar",
+ "OUTPUT" => "{startRow} to {endRow} of {filteredRows} ({totalRows})"
+ ],
+ "PRIVACY" => "Política de Privacidade",
+
+ "SLUG" => "Slug",
+ "SLUG_CONDITION" => "Slug/Condições",
+ "STATUS" => "Estado",
+
+ "UNKNOWN" => "Desconhecido",
+
+ // Actions words
+ "ACTIONS" => "Ações",
+ "ACTIVATE" => "Ativar",
+ "ACTIVE" => "Ativo",
+ "ADD" => "Adicionar",
+ "CANCEL" => "Cancelar",
+ "CONFIRM" => "Confirmar",
+ "CREATE" => "Criar",
+ "DELETE" => "Remover",
+ "DELETE_CONFIRM" => "Tem a certeza que deseja remover isto?",
+ "DELETE_CONFIRM_YES" => "Sim, remover",
+ "DELETE_CONFIRM_NAMED" => "Tem a certeza que deseja remover {{name}}?",
+ "DELETE_CONFIRM_YES_NAMED" => "Sim, remover {{name}}",
+ "DELETE_CANNOT_UNDONE" => "Esta ação não pode ser desfeita.",
+ "DELETE_NAMED" => "Remover {{name}}",
+ "DENY" => "Recusar",
+ "DISABLE" => "Desativar",
+ "DISABLED" => "Inativo",
+ "EDIT" => "Editar",
+ "ENABLE" => "Ativar",
+ "ENABLED" => "Ativo",
+ "OVERRIDE" => "Alterar",
+ "RESET" => "Apagar",
+ "SAVE" => "Guardar",
+ "SEARCH" => "Procurar",
+ "SORT" => "Ordenar",
+ "SUBMIT" => "Submeter",
+ "PRINT" => "Imprimir",
+ "REMOVE" => "Remover",
+ "UNACTIVATED" => "Inativo",
+ "UPDATE" => "Atualizar",
+ "YES" => "Sim",
+ "NO" => "Não",
+ "OPTIONAL" => "Opcional",
+
+ // Misc.
+ "BUILT_WITH_UF" => "Desenvolvido sobre UserFrosting ",
+ "ADMINLTE_THEME_BY" => "Tema por Almsaeed Studio . Todos os direitos reservados"
+];
diff --git a/login/app/sprinkles/core/locale/pt_PT/validate.php b/login/app/sprinkles/core/locale/pt_PT/validate.php
new file mode 100755
index 0000000..55fce76
--- /dev/null
+++ b/login/app/sprinkles/core/locale/pt_PT/validate.php
@@ -0,0 +1,25 @@
+ [
+ "ARRAY" => "Os valores para {{label}} devem estar contidos num array.",
+ "BOOLEAN" => "O valor para {{label}} deve ser '0' ou '1'.",
+ "INTEGER" => "O valor para {{label}} deve ser um inteiro.",
+ "INVALID_EMAIL" => "Endereço de email inválido.",
+ "LENGTH_RANGE" => "{{label}} deve conter entre {{min}} e {{max}} caracteres.",
+ "NO_LEAD_WS" => "O valor para {{label}} não pode começar por espaços, tabulações, ou outros espaços em branco.",
+ "NO_TRAIL_WS" => "O valor para {{label}} não pode terminar em espaços, tabulações, ou outros espaços em branco.",
+ "REQUIRED" => "Por favor especifique um valor para {{label}} ."
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/ru_RU/errors.php b/login/app/sprinkles/core/locale/ru_RU/errors.php
new file mode 100755
index 0000000..d2dd617
--- /dev/null
+++ b/login/app/sprinkles/core/locale/ru_RU/errors.php
@@ -0,0 +1,51 @@
+ [
+ "@TRANSLATION" => "Ошибка",
+
+ "400" => [
+ "TITLE" => "Ошибка 400: Неправильный запрос",
+ "DESCRIPTION" => "Это, вероятно, не ваша вина.",
+ ],
+
+ "404" => [
+ "TITLE" => "Ошибка 404: Не найдено",
+ "DESCRIPTION" => "Кажется, мы не можем найти то, что вам нужно.",
+ "DETAIL" => "Мы пытались найти вашу страницу...",
+ "EXPLAIN" => "Мы не можем найти страницу, которую вы искали.",
+ "RETURN" => 'В любом случае, нажмите здесь чтобы вернуться на главную страницу.'
+ ],
+
+ "CONFIG" => [
+ "TITLE" => "Проблема в конфигурации!",
+ "DESCRIPTION" => "Некоторые требования к конфигурации UserFrosting, не были соблюдены.",
+ "DETAIL" => "Что-то здесь не так.",
+ "RETURN" => 'Пожалуйста, исправьте следующие ошибки, затем перезагрузите .'
+ ],
+
+ "DESCRIPTION" => "Мы обнаружили большое и сильное нарушение.",
+ "DETAIL" => "Вот что мы получили:",
+
+ "ENCOUNTERED" => "Ох... что-то произошло. Мы не знаем, что.",
+
+ "MAIL" => "Неустранимая ошибка почтовой службы, обратитесь к администратору сервера. Если вы являетесь администратором, пожалуйста, проверьте логи.",
+
+ "RETURN" => 'Нажмите здесь для возврата на главную страницу.',
+
+ "SERVER" => "К сожалению, кажется сервер имеет ошибки. Если вы являетесь администратором сервера, пожалуйста проверьте логи.",
+
+ "TITLE" => "Сильное нарушение"
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/ru_RU/messages.php b/login/app/sprinkles/core/locale/ru_RU/messages.php
new file mode 100755
index 0000000..8de3730
--- /dev/null
+++ b/login/app/sprinkles/core/locale/ru_RU/messages.php
@@ -0,0 +1,120 @@
+ 1,
+
+ "ABOUT" => "О нас",
+
+ "CAPTCHA" => [
+ "@TRANSLATION" => "Капча",
+ "FAIL" => "Код безопасности был введен с ошибками.",
+ "SPECIFY" => "Введите код капчи",
+ "VERIFY" => "Проверьте капчу"
+ ],
+
+ "CSRF_MISSING" => "Отсутствует CSRF токен. Попробуйте обновить страницу и повторить попытку ещё раз?",
+
+ "DB_INVALID" => "Не удается подключиться к базе данных. Если вы являетесь администратором, пожалуйста проверьте лог ошибок.",
+ "DESCRIPTION" => "Описание",
+ "DOWNLOAD" => [
+ "@TRANSLATION" => "Скачать",
+ "CSV" => "Скачать CSV"
+ ],
+
+ "EMAIL" => [
+ "@TRANSLATION" => "Email",
+ "YOUR" => "Ваш e-mail"
+ ],
+
+ "HOME" => "Главная",
+
+ "LEGAL" => [
+ "@TRANSLATION" => "Правовая информация",
+ "DESCRIPTION" => "Наша правовая политика применима к использованию вами данного веб-сайта и наших услуг."
+ ],
+
+ "LOCALE" => [
+ "@TRANSLATION" => "Язык"
+ ],
+
+ "NAME" => "Имя",
+ "NAVIGATION" => "Навигация",
+ "NO_RESULTS" => "Извини, здесь ничего нет.",
+
+ "PAGINATION" => [
+ "GOTO" => "Перейти к странице",
+ "SHOW" => "Показать",
+
+ // Paginator
+ // possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
+ // also {page:input} & {startRow:input} will add a modifiable input in place of the value
+ "OUTPUT" => "{startRow} к {endRow} из {filteredRows} ({totalRows})",
+ "NEXT" => "Следующая",
+ "PREVIOUS" => "Предыдущая",
+ "FIRST" => "Первая",
+ "LAST" => "Последняя"
+ ],
+ "PRIVACY" => [
+ "@TRANSLATION" => "Политика конфиденциальности",
+ "DESCRIPTION" => "Наша политика конфиденциальности описывает, какую информацию мы собираем от вас и как мы будем использовать её."
+ ],
+
+ "SLUG" => "Метка",
+ "SLUG_CONDITION" => "Метка/Условия",
+ "SLUG_IN_USE" => "{{slug}} метка уже существует",
+ "STATUS" => "Статус",
+ "SUGGEST" => "Предложить",
+
+ "UNKNOWN" => "Неизвестно",
+
+ // Actions words
+ "ACTIONS" => "Действия",
+ "ACTIVATE" => "Активировать",
+ "ACTIVE" => "Активные",
+ "ADD" => "Добавить",
+ "CANCEL" => "Отмена",
+ "CONFIRM" => "Подтвердить",
+ "CREATE" => "Создать",
+ "DELETE" => "Удалить",
+ "DELETE_CONFIRM" => "Вы уверены, что хотите удалить это?",
+ "DELETE_CONFIRM_YES" => "Да, удалить",
+ "DELETE_CONFIRM_NAMED" => "Вы уверены, что хотите удалить {{name}}?",
+ "DELETE_CONFIRM_YES_NAMED" => "Да, удалить {{name}}",
+ "DELETE_CANNOT_UNDONE" => "Это действие нельзя будет отменить.",
+ "DELETE_NAMED" => "Удаление {{name}}",
+ "DENY" => "Запретить",
+ "DISABLE" => "Отключить",
+ "DISABLED" => "Отключено",
+ "EDIT" => "Изменить",
+ "ENABLE" => "Включить",
+ "ENABLED" => "Включено",
+ "OVERRIDE" => "Отменить",
+ "RESET" => "Сброс",
+ "SAVE" => "Сохранить",
+ "SEARCH" => "Поиск",
+ "SORT" => "Сортировка",
+ "SUBMIT" => "Отправить",
+ "PRINT" => "Печать",
+ "REMOVE" => "Удалить",
+ "UNACTIVATED" => "Не активировано",
+ "UPDATE" => "Обновить",
+ "YES" => "Да",
+ "NO" => "Нет",
+ "OPTIONAL" => "Дополнительно",
+
+ // Misc.
+ "BUILT_WITH_UF" => "Создано через UserFrosting ",
+ "ADMINLTE_THEME_BY" => "Тема от Almsaeed Studio . Все права защищены",
+ "WELCOME_TO" => "Добро пожаловать на {{title}}!"
+];
diff --git a/login/app/sprinkles/core/locale/ru_RU/validate.php b/login/app/sprinkles/core/locale/ru_RU/validate.php
new file mode 100755
index 0000000..6d684de
--- /dev/null
+++ b/login/app/sprinkles/core/locale/ru_RU/validate.php
@@ -0,0 +1,33 @@
+ [
+ "ARRAY" => "Значения для {{label}} должны быть элементами массива.",
+ "BOOLEAN" => "Значение {{label}} должно быть '0' или '1'.",
+ "INTEGER" => "Значение {{label}} должно быть целым.",
+ "INVALID_EMAIL" => "Неправильный email.",
+ "LENGTH_RANGE" => "{{label}} должно быть между {{min}} и {{max}} символов в длину.",
+ "MAX_LENGTH" => "{{label}} должны быть максимально {{max}} символов в длину.",
+ "MIN_LENGTH" => "{{label}} должно быть минимально {{min}} символов в длину.",
+ "NO_LEAD_WS" => "Значение {{label}} не может начинаться с пробелов, табуляции или других пробелов.",
+ "NO_TRAIL_WS" => "Значение {{label}} не может заканчиваться пробелами, табуляции или другими пробелами.",
+ "RANGE" => "Значение {{label}} должно быть между {{min}} и {{max}} симв.",
+ "REQUIRED" => "Пожалуйста, укажите значение для {{label}} .",
+ "SPRUNJE" => [
+ "BAD_FILTER" => "{{name}} не является допустимым фильтром.",
+ "BAD_LIST" => "{{name}} не является допустимым списком.",
+ "BAD_SORT" => "{{name}} не является допустимым для сортировки полей."
+ ]
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/th_TH/errors.php b/login/app/sprinkles/core/locale/th_TH/errors.php
new file mode 100755
index 0000000..8f9413e
--- /dev/null
+++ b/login/app/sprinkles/core/locale/th_TH/errors.php
@@ -0,0 +1,51 @@
+ [
+ "@TRANSLATION" => "ข้อผิดพลาด",
+
+ "400" => [
+ "TITLE" => "ข้อผิดพลาด 400: การร้องขอไม่ถูกต้อง",
+ "DESCRIPTION" => "นี่ไม่น่าจะเป็นความผิดพลาดของคุณ",
+ ],
+
+ "404" => [
+ "TITLE" => "ข้อผิดพลาด 404: ไม่พบหน้านี้",
+ "DESCRIPTION" => "ดูเหมือนเราจะไม่สามารถหาสิ่งที่คุณต้องการได้",
+ "DETAIL" => "เราพยายามได้ที่จะหาหน้าของคุณ...",
+ "EXPLAIN" => "เราไม่สามารถหาหน้าที่คุณมองหาอยู่ได้",
+ "RETURN" => 'อย่างไรก็ตาม คลิก ที่นี่ เพื่อกลับไปยังหน้าแรก'
+ ],
+
+ "CONFIG" => [
+ "TITLE" => "เกิดปัญหาจากการตั้งค่า UserFrosting!",
+ "DESCRIPTION" => "การตั้งค่าบางอย่างของ UserFrosting ยังไม่ตรงตามความต้องการ",
+ "DETAIL" => "มีบางอย่างไม่ถูกต้องอยู่",
+ "RETURN" => 'กรุณาแก้ไขข้อผิดพลาดดังกล่าว จากนั้น โหลดหน้านี้อีกครั้ง '
+ ],
+
+ "DESCRIPTION" => "เรารู้สึกความโกลาหลในกองทัพได้เป็นอย่างดี",
+ "DETAIL" => "นี่คือสิ่งที่เราพบ:",
+
+ "ENCOUNTERED" => "อืมม...บางอย่างเกิดขึ้น แต่เราไม่รู้ว่าคืออะไร",
+
+ "MAIL" => "เกิดข้อผิดพลาดร้ายแรงระหว่างการพยายามส่งอีเมล กรุณาติดต่อผู้ดูแลระบบของเซิฟเวอร์นี้ หากคุณเป็นผู้ดูแล กรุณาตรวจสอบบันทึกอีเมลของ UF",
+
+ "RETURN" => 'คลิก ที่นี่ เพื่อกลับไปยังหน้าแรก',
+
+ "SERVER" => "โอ้ว ดูเหมือนระบบของเราอาจจะผิดพลาดเอง หากคุณเป็นผู้ดูแล กรุณาตรวจสอบบันทึกข้อผิดพลาดของ PHP หรือ UF",
+
+ "TITLE" => "เกิดความโกลาหลในกองทัพ"
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/th_TH/messages.php b/login/app/sprinkles/core/locale/th_TH/messages.php
new file mode 100755
index 0000000..9d14041
--- /dev/null
+++ b/login/app/sprinkles/core/locale/th_TH/messages.php
@@ -0,0 +1,102 @@
+ 1,
+
+ "ABOUT" => "เกี่ยวกับ",
+
+ "CAPTCHA" => [
+ "@TRANSLATION" => "รหัสยืนยัน",
+ "FAIL" => "คุณยังกรอกรหัสยืนยันไม่ถูกต้อง",
+ "SPECIFY" => "กรอกรหัสยืนยัน",
+ "VERIFY" => "ตรวจสอบรหัสยืนยัน"
+ ],
+
+ "CSRF_MISSING" => "ไม่พบโทเคน CSRF กรุณารีเฟรชแล้วส่งข้อมูลใหม่",
+
+ "DB_INVALID" => "ไม่สามารถเชื่อมต่อกับฐานข้อมูลได้ หากคุณเป็นผู้ดูแลระบบ กรุณาตรวจสอบบันทึกข้อผิดพลาด",
+ "DESCRIPTION" => "รายละเอียด",
+ "DOWNLOAD" => [
+ "@TRANSLATION" => "ดาวน์โหลด",
+ "CSV" => "ดาวน์โหลด CSV"
+ ],
+
+ "EMAIL" => [
+ "@TRANSLATION" => "อีเมล",
+ "YOUR" => "ที่อยู่อีเมลของคุณ"
+ ],
+
+ "HOME" => "หน้าแรก",
+
+ "LEGAL" => "นโยบายทางกฎหมาย",
+
+ "LOCALE" => [
+ "@TRANSLATION" => "ภาษา"
+ ],
+
+ "NAME" => "ชื่อ",
+ "NAVIGATION" => "เมนูนำทาง",
+
+ "PAGINATION" => [
+ "GOTO" => "ข้ามไปยังหน้า",
+ "SHOW" => "แสดง",
+ "OUTPUT" => "{startRow} to {endRow} of {filteredRows} ({totalRows})"
+ ],
+ "PRIVACY" => "นโยบายความเป็นส่วนตัว",
+
+ "SLUG" => "ข้อกำหนด",
+ "SLUG_CONDITION" => "ข้อกำหนด/เงื่อนไข",
+ "STATUS" => "สถานะ",
+
+ "UNKNOWN" => "ไม่ทราบ",
+
+ // Actions words
+ "ACTIONS" => "การดำเนินการ",
+ "ACTIVATE" => "เปิดใช้งาน",
+ "ACTIVE" => "เปิดใช้งานอยู่",
+ "ADD" => "เพิ่ม",
+ "CANCEL" => "ยกเลิก",
+ "CONFIRM" => "ยืนยัน",
+ "CREATE" => "สร้าง",
+ "DELETE" => "ลบ",
+ "DELETE_CONFIRM" => "คุณต้องการที่จะลบใช่หรือไม่?",
+ "DELETE_CONFIRM_YES" => "ใช่ ลบเลย",
+ "DELETE_CONFIRM_NAMED" => "คุณต้องการที่จะลบ {{name}} ใช่หรือไม่?",
+ "DELETE_CONFIRM_YES_NAMED" => "ใช่ ลบ {{name}} เลย",
+ "DELETE_CANNOT_UNDONE" => "การดำเนินการนี้ไม่สามารถยกเลิกได้",
+ "DELETE_NAMED" => "ลบ {{name}}",
+ "DENY" => "ปฏิเสธ",
+ "DISABLE" => "ปิดการใช้งาน",
+ "DISABLED" => "ปิดการใช้งานอยู่",
+ "EDIT" => "แก้ไข",
+ "ENABLE" => "เปิด",
+ "ENABLED" => "เปิดอยู่",
+ "OVERRIDE" => "เขียนทับ",
+ "RESET" => "รีเซ็ต",
+ "SAVE" => "บันทึก",
+ "SEARCH" => "ค้นหา",
+ "SORT" => "ประเภท",
+ "SUBMIT" => "ส่ง",
+ "PRINT" => "พิมพ์",
+ "REMOVE" => "เอาออก",
+ "UNACTIVATED" => "ไม่มีการเปิดใช้",
+ "UPDATE" => "ปรับปรุง",
+ "YES" => "ใช่",
+ "NO" => "ไม่",
+ "OPTIONAL" => "ตัวเลือกเพิ่มเติม",
+
+ // Misc.
+ "BUILT_WITH_UF" => "สร้างด้วย UserFrosting ",
+ "ADMINLTE_THEME_BY" => "ธีมโดย Almsaeed Studio สงวนลิขสิทธิ์"
+];
diff --git a/login/app/sprinkles/core/locale/th_TH/validate.php b/login/app/sprinkles/core/locale/th_TH/validate.php
new file mode 100755
index 0000000..b28c021
--- /dev/null
+++ b/login/app/sprinkles/core/locale/th_TH/validate.php
@@ -0,0 +1,25 @@
+ [
+ "ARRAY" => "ค่าของ {{label}} จะต้องเป็น Array",
+ "BOOLEAN" => "ค่าของ {{label}} จะต้องเป็น '0' หรือ '1'",
+ "INTEGER" => "ค่าของ {{label}} จะต้องเป็นตัวเลข",
+ "INVALID_EMAIL" => "ที่อยู่อีเมลไม่ถูกต้อง",
+ "LENGTH_RANGE" => "ความยาวของ {{label}} จะต้องอยู่ระหว่าง {{min}} ถึง {{max}} ตัวอักษร",
+ "NO_LEAD_WS" => "ค่าของ {{label}} ไม่สามารถเริ่มต้นด้วยช่องว่าง หรือ แท็บ",
+ "NO_TRAIL_WS" => "ค่าของ {{label}} ไม่สามารถลงท้ายด้วยช่องว่าง หรือ แท็บ",
+ "REQUIRED" => "กรุณากำหนดค่าของ {{label}} "
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/valitron/ar.php b/login/app/sprinkles/core/locale/valitron/ar.php
new file mode 100755
index 0000000..0c03547
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/ar.php
@@ -0,0 +1,28 @@
+ "مطلوب",
+ 'equals' => "يجب أن يكون مساوي لي '%s'",
+ 'different' => "يجب ان يكون غير '%s'",
+ 'accepted' => "يجب ان يكون نعم",
+ 'numeric' => "يجب ان يكون رقم",
+ 'integer' => "يجب ان يكون رقم (0-9)",
+ 'length' => "يجب ان يكون أطول من %d",
+ 'min' => "يجب ان يكون اعلي من %s",
+ 'max' => "يجب ان يكون اقل من %s",
+ 'in' => "الُمدخل يغير صحيح",
+ 'notIn' => "الُمدخل يغير صحيح",
+ 'ip' => "رقم الإتصال غير صحيح",
+ 'email' => "البريد الألكتروني غير صحيح",
+ 'url' => "الرابط غير صحيح",
+ 'urlActive' => "يجب أن يكون نطاق فعال",
+ 'alpha' => "يجب أن يحتوي فقط علي a-z",
+ 'alphaNum' => "يجب ان يحتوي فقط a-z او ارقام 0-9",
+ 'slug' => "يجب ان يحتوي فقط علي a-z, و ارقام 0-9, شرطات و خط سفلي",
+ 'regex' => "خطا بالصيغة",
+ 'date' => "خطا بالتاريخ",
+ 'dateFormat' => "يجب ان يكون تاريخ بهذه الصيغة '%s'",
+ 'dateBefore' => "التاريخ يجب ان يكون قبل '%s'",
+ 'dateAfter' => "التاريخ يجب ان يكون بعد '%s'",
+ 'contains' => "يجب ان يحتوي %s"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/de.php b/login/app/sprinkles/core/locale/valitron/de.php
new file mode 100755
index 0000000..4847bd0
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/de.php
@@ -0,0 +1,33 @@
+ "ist erforderlich",
+ 'equals' => "muss identisch mit '%s' sein",
+ 'different' => "muss sich von '%s' unterscheiden",
+ 'accepted' => "muss markiert sein",
+ 'numeric' => "muss eine Zahl sein",
+ 'integer' => "muss eine ganze Zahl sein",
+ 'length' => "kann nicht länger als %d sein",
+ 'min' => "muss größer als %s sein",
+ 'max' => "muss kleiner als %s sein",
+ 'in' => "enthält einen ungültigen Wert",
+ 'notIn' => "enthält einen ungültigen Wert",
+ 'ip' => "enthält keine gültige IP-Addresse",
+ 'email' => "enthält keine gültige E-Mail-Adresse",
+ 'url' => "enthält keine gültige URL",
+ 'urlActive' => "muss eine aktive Domain sein",
+ 'alpha' => "darf nur Buchstaben enthalten",
+ 'alphaNum' => "darf nur Buchstaben und Ganzzahlen enthalten",
+ 'slug' => "darf nur Buchstaben, Ganzzahlen, Schrägstriche und Grundstriche enthalten",
+ 'regex' => "enthält ungültige Zeichen",
+ 'date' => "enthält kein gültiges Datum",
+ 'dateFormat' => "benötigt ein Datum im Format '%s'",
+ 'dateBefore' => "benötigt ein Datum, das vor dem '%s' liegt",
+ 'dateAfter' => "benötigt ein Datum, das nach dem '%s' liegt",
+ 'contains' => "muss %s beinhalten",
+ 'boolean' => "muss ein Wahrheitswert sein",
+ 'lengthBetween' => "benötigt zwischen %d und %d Zeichen",
+ 'creditCard' => "muss eine gültige Kreditkartennummer sein",
+ "lengthMin" => "muss mindestens %d Zeichen enthalten",
+ "lengthMax" => "kann nicht mehr als %d Zeichen enthalten"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/el.php b/login/app/sprinkles/core/locale/valitron/el.php
new file mode 100755
index 0000000..8f27d39
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/el.php
@@ -0,0 +1,34 @@
+ "είναι απαραίτητο",
+ 'equals' => "πρέπει να είναι ίδιο με '%s'",
+ 'different' => "πρέπει να διαφέρει από '%s'",
+ 'accepted' => "πρέπει να έχει αποδεχτεί",
+ 'numeric' => "πρέπει να είναι αριθμός",
+ 'integer' => "πρέπει να είναι ακέραιος αριθμός (0-9)",
+ 'length' => "πρέπει να είναι μεγαλύτερο από %d",
+ 'min' => "πρέπει να είναι τουλάχιστον %s",
+ 'max' => "δεν πρέπει να είναι περισσότερο από %s",
+ 'in' => "περιέχει μη έγκυρη τιμή",
+ 'notIn' => "περιέχει μη έγκυρη τιμή",
+ 'ip' => "δεν είναι έγκυρη διεύθυνση IP",
+ 'email' => "δεν είναι έγκυρη διεύθυνση email",
+ 'url' => "δεν είναι URL",
+ 'urlActive' => "πρέπει να είναι ενεργό domain",
+ 'alpha' => "πρέπει να περιέχει μόνο χαρακτήρες",
+ 'alphaNum' => "πρέπει να περιέχει μόνο χαρακτήρες και/ή αριθμούς",
+ 'slug' => "πρέπει να περιέχει μόνο χαρακτήρες, αριθμούς, παύλες και κάτω παύλες",
+ 'regex' => "περιέχει μη έγκυρους χαρακτήρες",
+ 'date' => "δεν είναι έγκυρη ημερομηνία",
+ 'dateFormat' => "πρέπει να είναι ημερομηνία της μορφής '%s'",
+ 'dateBefore' => "πρέπει να είναι ημερομηνία πριν από '%s'",
+ 'dateAfter' => "πρέπει να είναι ημερομηνία μετά από '%s'",
+ 'contains' => "πρέπει να περιέχει %s",
+ 'boolean' => "πρέπει να είναι boolean",
+ 'lengthBetween' => "πρέπει να είναι μεταξύ %d και %d χαρακτήρων",
+ 'creditCard' => "πρέπει να είναι ένα έγκυρο νούμερο πιστωτικής κάρτας",
+ "lengthMin" => "πρέπει να περιέχει περισσότερους από %d χαρακτήρες",
+ "lengthMax" => "πρέπει να περιέχει λιγότερους από %d χαρακτήρες",
+ "instanceOf" => "πρέπει να είναι αντικείμενο της '%s'"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/en.php b/login/app/sprinkles/core/locale/valitron/en.php
new file mode 100755
index 0000000..9dd9cd8
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/en.php
@@ -0,0 +1,34 @@
+ "is required",
+ 'equals' => "must be the same as '%s'",
+ 'different' => "must be different than '%s'",
+ 'accepted' => "must be accepted",
+ 'numeric' => "must be numeric",
+ 'integer' => "must be an integer (0-9)",
+ 'length' => "must be longer than %d",
+ 'min' => "must be at least %s",
+ 'max' => "must be no more than %s",
+ 'in' => "contains invalid value",
+ 'notIn' => "contains invalid value",
+ 'ip' => "is not a valid IP address",
+ 'email' => "is not a valid email address",
+ 'url' => "not a URL",
+ 'urlActive' => "must be an active domain",
+ 'alpha' => "must contain only letters a-z",
+ 'alphaNum' => "must contain only letters a-z and/or numbers 0-9",
+ 'slug' => "must contain only letters a-z, numbers 0-9, dashes and underscores",
+ 'regex' => "contains invalid characters",
+ 'date' => "is not a valid date",
+ 'dateFormat' => "must be date with format '%s'",
+ 'dateBefore' => "must be date before '%s'",
+ 'dateAfter' => "must be date after '%s'",
+ 'contains' => "must contain %s",
+ 'boolean' => "must be a boolean",
+ 'lengthBetween' => "must be between %d and %d characters",
+ 'creditCard' => "must be a valid credit card number",
+ "lengthMin" => "must contain greater than %d characters",
+ "lengthMax" => "must contain less than %d characters",
+ "instanceOf" => "must be an instance of '%s'"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/es.php b/login/app/sprinkles/core/locale/valitron/es.php
new file mode 100755
index 0000000..3c177f6
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/es.php
@@ -0,0 +1,34 @@
+ "es requerido",
+ 'equals' => "debe ser igual a '%s'",
+ 'different' => "debe ser diferente a '%s'",
+ 'accepted' => "debe ser aceptado",
+ 'numeric' => "debe ser numérico",
+ 'integer' => "debe ser un entero (0-9)",
+ 'length' => "debe ser mas largo de %d",
+ 'min' => "debe ser mayor a %s",
+ 'max' => "debe ser menor a %s",
+ 'in' => "contiene un valor invalido",
+ 'notIn' => "contiene un valor invalido",
+ 'ip' => "no es una dirección IP",
+ 'email' => "no es un correo electrónico válido",
+ 'url' => "no es una URL",
+ 'urlActive' => "debe ser un dominio activo",
+ 'alpha' => "debe contener solo letras a-z",
+ 'alphaNum' => "debe contener solo letras a-z o números 0-9",
+ 'slug' => "debe contener solo letras a-z, números 0-9, diagonales y guiones bajos",
+ 'regex' => "contiene caracteres inválidos",
+ 'date' => "no es una fecha válida",
+ 'dateFormat' => "debe ser una fecha con formato '%s'",
+ 'dateBefore' => "debe ser una fecha antes de '%s'",
+ 'dateAfter' => "debe ser una fecha después de '%s'",
+ 'contains' => "debe contener %s",
+ 'boolean' => "debe ser booleano",
+ 'lengthBetween' => "debe ser entre %d y %d caracteres",
+ 'creditCard' => "debe ser un numero de tarjeta de crédito válido",
+ "lengthMin" => "debe contener mas de %d caracteres",
+ "lengthMax" => "debe contener menos de %d caracteres",
+ "instanceOf" => "debe ser una instancia de '%s'"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/fr.php b/login/app/sprinkles/core/locale/valitron/fr.php
new file mode 100755
index 0000000..2572201
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/fr.php
@@ -0,0 +1,34 @@
+ "est obligatoire",
+ 'equals' => "doit être identique à '%s'",
+ 'different' => "doit être différent de '%s'",
+ 'accepted' => "doit être accepté",
+ 'numeric' => "doit être numérique",
+ 'integer' => "doit être un entier (0-9)",
+ 'length' => "doit être plus long que %d",
+ 'min' => "doit être plus grand que %s",
+ 'max' => "doit être plus petit que %s",
+ 'in' => "contient une valeur non valide",
+ 'notIn' => "contient une valeur non valide",
+ 'ip' => "n'est pas une adresse IP valide",
+ 'email' => "n'est pas une adresse email valide",
+ 'url' => "n'est pas une URL",
+ 'urlActive' => "doit être un domaine actif",
+ 'alpha' => "doit contenir uniquement les lettres a-z",
+ 'alphaNum' => "doit contenir uniquement des lettres de a-z et/ou des chiffres 0-9",
+ 'slug' => "doit contenir uniquement des lettres de a-z, des chiffres 0-9, des tirets et des traits soulignés",
+ 'regex' => "contient des caractères invalides",
+ 'date' => "n'est pas une date valide",
+ 'dateFormat' => "doit être une date avec le format '%s'",
+ 'dateBefore' => "doit être une date avant '%s'",
+ 'dateAfter' => "doit être une date après '%s'",
+ 'contains' => "doit contenir %s",
+ 'boolean' => "doit être un booléen",
+ 'lengthBetween' => "doit contenir entre %d et %d caractères",
+ 'creditCard' => "doit être un numéro de carte de crédit valide",
+ "lengthMin" => "doit contenir plus de %d caractères",
+ "lengthMax" => "doit contenir moins de %d caractères",
+ "instanceOf" => "doit être une instance de '%s'"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/id.php b/login/app/sprinkles/core/locale/valitron/id.php
new file mode 100755
index 0000000..e4044cf
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/id.php
@@ -0,0 +1,33 @@
+ "harus diisi",
+ 'equals' => "harus sama dengan '%s'",
+ 'different' => "harus berbeda dengan '%s'",
+ 'accepted' => "harus diterima (accepted)",
+ 'numeric' => "harus berupa nomor/angka",
+ 'integer' => "harus berupa nilai integer (0-9)",
+ 'length' => "harus lebih panjang dari %d",
+ 'min' => "harus lebih besar dari %s",
+ 'max' => "harus kurang dari %s",
+ 'in' => "berisi nilai/value yang tidak valid",
+ 'notIn' => "berisi nilai/value yang tidak valid",
+ 'ip' => "format alamat IP tidak benar",
+ 'email' => "format alamat email tidak benar",
+ 'url' => "bukan format URL yang benar",
+ 'urlActive' => "harus berupa domain aktif",
+ 'alpha' => "hanya boleh menggunakan huruf a-z",
+ 'alphaNum' => "hanya boleh menggunakan huruf a-z dan atau nomor 0-9",
+ 'slug' => "hanya boleh menggunakan huruf a-z, nomor 0-9, tanda minus (-), dan uderscore atau strip bawah (_)",
+ 'regex' => "berisi karakter yang tidak valid",
+ 'date' => "format tanggal tidak valid",
+ 'dateFormat' => "harus berupa tanggal dengan format '%s'",
+ 'dateBefore' => "tanggal harus sebelum tanggal '%s'",
+ 'dateAfter' => "tanggal harus sesudah tanggal '%s'",
+ 'contains' => "harus berisi %s",
+ 'boolean' => "harus berupa nilai boolean",
+ 'lengthBetween' => "harus diantara karakter %d dan %d",
+ 'creditCard' => "nomor kartu kredit harus valid",
+ "lengthMin" => "minimal berisi %d karakter",
+ "lengthMax" => "maksimal berisi %d karakter"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/it.php b/login/app/sprinkles/core/locale/valitron/it.php
new file mode 100755
index 0000000..ee7a5c1
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/it.php
@@ -0,0 +1,31 @@
+ "è obbligatorio",
+ 'equals' => "deve essere uguale a '%s'",
+ 'different' => "deve essere differente da '%s'",
+ 'accepted' => "deve essere accettato",
+ 'numeric' => "deve essere numerico",
+ 'integer' => "deve essere un intero (0-9)",
+ 'length' => "deve avere una lunghezza di %d",
+ 'min' => "deve essere superiore a %s",
+ 'max' => "deve essere inferiore a %s",
+ 'in' => "contiene un valore non valido",
+ 'notIn' => "contiene un valore non valido",
+ 'ip' => "non è un indirizzo IP valido",
+ 'email' => "non è un indirizzo email valido",
+ 'url' => "non è una URL",
+ 'urlActive' => "deve essere un dominio attivo",
+ 'alpha' => "deve contenere solamente lettere (a-z)",
+ 'alphaNum' => "deve contenere solamente lettere (a-z) e/o numeri (0-9)",
+ 'slug' => "deve contenere solamente lettere (a-z), numeri (0-9), trattini (-) e trattini bassi (_)",
+ 'regex' => "contiene caratteri non validi",
+ 'date' => "non è una data valida",
+ 'dateFormat' => "deve essere una data nel formato '%s'",
+ 'dateBefore' => "deve essere una data precedente al '%s'",
+ 'dateAfter' => "deve essere una data successiva al '%s'",
+ 'contains' => "deve contenere %s",
+ 'boolean' => "deve essere un booleano",
+ 'lengthBetween' => "deve essere compreso tra %d e %d caratteri",
+ 'creditCard' => "deve essere un numero di carta di credito valido"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/ja.php b/login/app/sprinkles/core/locale/valitron/ja.php
new file mode 100755
index 0000000..6fa494b
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/ja.php
@@ -0,0 +1,33 @@
+ "を入力してください",
+ 'equals' => "は「%s」と同じ内容を入力してください",
+ 'different' => "は「%s」と異なる内容を入力してください",
+ 'accepted' => "に同意してください",
+ 'numeric' => "は数値を入力してください",
+ 'integer' => "は半角数字で入力してください",
+ 'length' => "は%d文字で入力してください",
+ 'min' => "には%sより大きな値を入力してください",
+ 'max' => "には%sより小さな値を入力してください",
+ 'in' => "には選択できない値が含まれています",
+ 'notIn' => "には選択できない値が含まれています",
+ 'ip' => "はIPアドレスの書式として正しくありません",
+ 'email' => "はメールアドレスの書式として正しくありません",
+ 'url' => "はURLの書式として正しくありません",
+ 'urlActive' => "はアクティブなドメインではありません",
+ 'alpha' => "は半角英字で入力してください",
+ 'alphaNum' => "は半角英数字で入力してください",
+ 'slug' => "は半角英数字、もしくは「-」「_」の文字で入力してください",
+ 'regex' => "の書式が正しくありません",
+ 'date' => "は日付の書式として正しくありません",
+ 'dateFormat' => "は「%s」の書式で日付を入力してください",
+ 'dateBefore' => "は「%s」以前の日付を入力してください",
+ 'dateAfter' => "は「%s」以後の日付を入力してください",
+ 'contains' => "は「%s」を含んでいなければいけません",
+ 'boolean' => "は真偽値である必要があります",
+ 'lengthBetween' => "は%d〜%d文字で入力してください",
+ 'creditCard' => "はクレジットカード番号の書式として正しくありません",
+ "lengthMin" => "は%d文字以上入力してください",
+ "lengthMax" => "は%d文字以内で入力してください"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/lv.php b/login/app/sprinkles/core/locale/valitron/lv.php
new file mode 100755
index 0000000..9b5e54d
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/lv.php
@@ -0,0 +1,31 @@
+ "ir obligāts lauks",
+ 'equals' => "jāsakrīt ar '%s'",
+ 'different' => "nedrīkst sakrist ar '%s' lauku",
+ 'accepted' => "laukam jābūt apstiprinātam",
+ 'numeric' => "jābūt skaitliskai vērtībai",
+ 'integer' => "jābūt ciparam (0-9)",
+ 'length' => "nedrīkst būt garāks par %d simboliem",
+ 'min' => "jābūt garākam par %s simboliem",
+ 'max' => "jābūt īsākam par %s simboliem",
+ 'in' => "lauks satur nederīgu vērtību",
+ 'notIn' => "lauks satur nederīgu vērtību",
+ 'ip' => " lauks nav derīga IP adrese",
+ 'email' => "lauks nav norādīta derīga epasta adrese",
+ 'url' => "lauks nav tīmekļa saite",
+ 'urlActive' => "saite neatrodas esošajā domēna vārdā",
+ 'alpha' => "lauks var saturēt tikai alfabēta burtus a-z",
+ 'alphaNum' => "lauks var saturēt tikai alfabēta burtus un/vai ciparus 0-9",
+ 'slug' => "lauks var saturēt tikai alfabēta burtus un/vai ciparus 0-9, domuzīmes and zemsvītras",
+ 'regex' => "lauks satur nederīgus simbolus",
+ 'date' => "lauks ir nederīgā datuma formātā",
+ 'dateFormat' => "laukam jābūt datuma formātā '%s'",
+ 'dateBefore' => "lauka datumam jābūt pirms '%s'",
+ 'dateAfter' => "lauka datumam jābūt pēc '%s'",
+ 'contains' => "laukam jāsatur %s",
+ 'boolean' => "laukam jābūt ir/nav vērtībai",
+ 'lengthBetween' => "lauka garumam jābūt no %d līdz %d simbolu garam",
+ 'creditCard' => "laukam jābūt derīgam kredītkartes numuram"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/pt-br.php b/login/app/sprinkles/core/locale/valitron/pt-br.php
new file mode 100755
index 0000000..74c5660
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/pt-br.php
@@ -0,0 +1,28 @@
+ "é obrigatório",
+ 'equals' => "deve ser o mesmo que '%s'",
+ 'different' => "deve ser diferente de '%s'",
+ 'accepted' => "deve ser aceito",
+ 'numeric' => "deve ser um número",
+ 'integer' => "deve ser um inteiro (0-9)",
+ 'length' => "deve ter mais que %d caracteres",
+ 'min' => "deve ser maior que %s",
+ 'max' => "deve ser menor que %s",
+ 'in' => "contém um valor inválido",
+ 'notIn' => "contém um valor inválido",
+ 'ip' => "não é um IP válido",
+ 'email' => "não é um email válido",
+ 'url' => "não é uma URL válida",
+ 'urlActive' => "deve ser um domínio ativo",
+ 'alpha' => "deve conter as letras a-z",
+ 'alphaNum' => "deve conter apenas letras a-z e/ou números 0-9",
+ 'slug' => "deve conter apenas letras a-z, números 0-9, ou os caracteres - ou _",
+ 'regex' => "contém caracteres inválidos",
+ 'date' => "não é uma data válida",
+ 'dateFormat' => "deve ser uma data no formato '%s'",
+ 'dateBefore' => "deve ser uma data anterior a '%s'",
+ 'dateAfter' => "deve ser uma data posterior a '%s'",
+ 'contains' => "deve conter %s"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/ro.php b/login/app/sprinkles/core/locale/valitron/ro.php
new file mode 100755
index 0000000..f7acce3
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/ro.php
@@ -0,0 +1,33 @@
+ "este necesar",
+ 'equals' => "trebuie sa fie la fel ca '%s'",
+ 'different' => "trebuie sa fie diferit ca '%s'",
+ 'accepted' => "trebuie acceptat",
+ 'numeric' => "trebuie sa fie numeric",
+ 'integer' => "trebuie sa fie o cifra (0-9)",
+ 'length' => "trebuie sa fie mai lung de %d",
+ 'min' => "trebuie sa fie minim %s",
+ 'max' => "nu trebuie sa fie mai mare de %s",
+ 'in' => "contine valori invalide",
+ 'notIn' => "contine valori invalide",
+ 'ip' => "nu este o adresa de IP valida",
+ 'email' => "nu este o adresa de email valida",
+ 'url' => "nu este un URL",
+ 'urlActive' => "trebuie sa fie un domeniu activ",
+ 'alpha' => "poate contine doar litere a-z",
+ 'alphaNum' => "poate contine doar litere a-z si/sau numere 0-9",
+ 'slug' => "poate contine doar litere a-z, numere 0-9, minus si underscore",
+ 'regex' => "contine caractere invalide",
+ 'date' => "nu este o data valida",
+ 'dateFormat' => "trebuie sa fie o data cu formatul '%s'",
+ 'dateBefore' => "trebuie sa fie o data inainte de '%s'",
+ 'dateAfter' => "trebuie sa fie o data dupa '%s'",
+ 'contains' => "trebuie sa contina %s",
+ 'boolean' => "trebuie sa fie valoare logica (boolean)",
+ 'lengthBetween' => "trebuie sa fie intre %d si %d caractere",
+ 'creditCard' => "trebuie sa fie un card de credit valid",
+ "lengthMin" => "trebuie sa contina mai mult de %d caractere",
+ "lengthMax" => "trebuie sa contina mai putin de %d caractere",
+ "instanceOf" => "trebuie sa fie o instanta a '%s'"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/ru.php b/login/app/sprinkles/core/locale/valitron/ru.php
new file mode 100755
index 0000000..78fe98f
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/ru.php
@@ -0,0 +1,33 @@
+ "обязательно для заполнения",
+ 'equals' => "должно содержать '%s'",
+ 'different' => "должно отличаться от '%s'",
+ 'accepted' => "должно быть указано",
+ 'numeric' => "должно содержать числовое значение",
+ 'integer' => "должно быть числом",
+ 'length' => "должно быть длиннее, чем %d",
+ 'min' => "должно быть больше, чем %s",
+ 'max' => "должно быть меньше, чем %s",
+ 'in' => "содержит неверное значение",
+ 'notIn' => "содержит неверное значение",
+ 'ip' => "не является валидным IP адресом",
+ 'email' => "не является валидным email адресом",
+ 'url' => "не является ссылкой",
+ 'urlActive' => "содержит не активную ссылку",
+ 'alpha' => "должно содержать только латинские символы",
+ 'alphaNum' => "должно содержать только латинские символы и/или цифры",
+ 'slug' => "должно содержать только латинские символы, цифры, тире и подчёркивания",
+ 'regex' => "содержит недопустимые символы",
+ 'date' => "не является датой",
+ 'dateFormat' => "должно содержать дату следующего формата: %s",
+ 'dateBefore' => "должно содержать дату не позднее, чем %s",
+ 'dateAfter' => "должно содержать дату не ранее, чем %s",
+ 'contains' => "должно содержать %s",
+ 'boolean' => "должно содержать логическое значение",
+ 'lengthBetween' => "должно содержать от %d до %d символов",
+ 'creditCard' => "должно быть номером кредитной карты",
+ "lengthMin" => "должно содержать более %d символов",
+ "lengthMax" => "должно содержать менее %d символов"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/th.php b/login/app/sprinkles/core/locale/valitron/th.php
new file mode 100755
index 0000000..2e4fa25
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/th.php
@@ -0,0 +1,34 @@
+ "ต้องการ",
+ 'equals' => "จะต้องเหมือนกับ '%s'",
+ 'different' => "จะต้องไม่ใช่ '%s'",
+ 'accepted' => "จะต้องยอมรับ",
+ 'numeric' => "จะต้องเป็นตัวเลข",
+ 'integer' => "จะต้องเป็นตัวเลขหลักเดียว (0-9)",
+ 'length' => "จะต้องมีความยาวมากกว่า %d",
+ 'min' => "จะต้องมีอย่างน้อย %s",
+ 'max' => "จะต้องมีไม่มากไปกว่า %s",
+ 'in' => "ประกอบด้วยค่าที่ไม่ถูกต้อง",
+ 'notIn' => "ประกอบด้วยค่าที่ไม่ถูกต้อง",
+ 'ip' => "ไม่ใช่ที่อยู่ไอพีที่ถูกต้อง",
+ 'email' => "ไม่ใช่ที่อยู่อีเมลที่ถูกต้อง",
+ 'url' => "ไม่ใช่ลิงก์",
+ 'urlActive' => "จะต้องเป็นโดเมนที่มีการใช้งานอยู่",
+ 'alpha' => "จะต้องประกอบไปด้วยตัวอักษร a-z เท่านั้น",
+ 'alphaNum' => "จะต้องประกอบไปด้วยตัวอักษร a-z และ/หรือ เลข 0-9",
+ 'slug' => "จะต้องประกอบไปด้วยตัวอักษร a-z เลข 0-9 ขีดกลาง และขีดล่าง",
+ 'regex' => "ประกอบด้วยอักขระที่ไม่ถูกต้อง",
+ 'date' => "ไม่ใช่วันที่ที่ถูกต้อง",
+ 'dateFormat' => "จะต้องเป็นวันที่ที่มีรูปแบบ '%s'",
+ 'dateBefore' => "จะต้องเป็นวันที่ก่อน '%s'",
+ 'dateAfter' => "จะต้องเป็นวันที่หลังจาก '%s'",
+ 'contains' => "จะต้องประกอบไปด้วย %s",
+ 'boolean' => "จะต้องเป็นใช่ หรือ ไม่ใช่",
+ 'lengthBetween' => "จะต้องอยู่ระหว่าง %d ถึง %d ตัวอักษร",
+ 'creditCard' => "จะต้องเป็นหมายเลขบัตรเครดิตที่ถูกต้อง",
+ "lengthMin" => "จะต้องมีความยาวมากกว่า %d ตัวอักษร",
+ "lengthMax" => "จะต้องมีความยาวน้อยกว่า %d ตัวอักษร",
+ "instanceOf" => "จะต้องเป็นกรณีของ '%s'"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/zh-cn.php b/login/app/sprinkles/core/locale/valitron/zh-cn.php
new file mode 100755
index 0000000..4471ba8
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/zh-cn.php
@@ -0,0 +1,28 @@
+ "不能为空",
+ 'equals' => "必须和 '%s' 一致",
+ 'different' => "必须和 '%s' 不一致",
+ 'accepted' => "必须接受",
+ 'numeric' => "只能是数字",
+ 'integer' => "只能是整数(0-9)",
+ 'length' => "长度必须大于 %d",
+ 'min' => "必须大于 %s",
+ 'max' => "必须小于 %s",
+ 'in' => "无效的值",
+ 'notIn' => "无效的值",
+ 'ip' => "无效IP地址",
+ 'email' => "无效邮箱地址",
+ 'url' => "无效的URL",
+ 'urlActive' => "必须是可用的域名",
+ 'alpha' => "只能包括英文字母(a-z)",
+ 'alphaNum' => "只能包括英文字母(a-z)和数字(0-9)",
+ 'slug' => "只能包括英文字母(a-z)、数字(0-9)、破折号和下划线",
+ 'regex' => "无效格式",
+ 'date' => "无效的日期",
+ 'dateFormat' => "日期的格式应该为 '%s'",
+ 'dateBefore' => "日期必须在 '%s' 之前",
+ 'dateAfter' => "日期必须在 '%s' 之后",
+ 'contains' => "必须包含 %s"
+);
diff --git a/login/app/sprinkles/core/locale/valitron/zh-tw.php b/login/app/sprinkles/core/locale/valitron/zh-tw.php
new file mode 100755
index 0000000..df702c5
--- /dev/null
+++ b/login/app/sprinkles/core/locale/valitron/zh-tw.php
@@ -0,0 +1,28 @@
+ "不能為空",
+ 'equals' => "必須和 '%s' 一致",
+ 'different' => "必須和 '%s' 不一致",
+ 'accepted' => "必須接受",
+ 'numeric' => "只能是數字",
+ 'integer' => "只能是整數(0-9)",
+ 'length' => "長度必須大於 %d",
+ 'min' => "必須大於 %s",
+ 'max' => "必須小於 %s",
+ 'in' => "無效的值",
+ 'notIn' => "無效的值",
+ 'ip' => "無效IP地址",
+ 'email' => "無效郵箱地址",
+ 'url' => "無效的URL",
+ 'urlActive' => "必須是可用的域名",
+ 'alpha' => "只能包括英文字母(a-z)",
+ 'alphaNum' => "只能包括英文字母(a-z)和數字(0-9)",
+ 'slug' => "只能包括英文字母(a-z)、數字(0-9)、破折號和下劃線",
+ 'regex' => "無效格式",
+ 'date' => "無效的日期",
+ 'dateFormat' => "日期的格式應該為 '%s'",
+ 'dateBefore' => "日期必須在 '%s' 之前",
+ 'dateAfter' => "日期必須在 '%s' 之後",
+ 'contains' => "必須包含 %s"
+);
diff --git a/login/app/sprinkles/core/locale/zh_CN/errors.php b/login/app/sprinkles/core/locale/zh_CN/errors.php
new file mode 100755
index 0000000..9192e32
--- /dev/null
+++ b/login/app/sprinkles/core/locale/zh_CN/errors.php
@@ -0,0 +1,49 @@
+ [
+ "@TRANSLATION" => "错误",
+
+ "400" => [
+ "TITLE" => "错误 400: 无效请求",
+ "DESCRIPTION" => "这好像不是你的错.",
+ ],
+
+ "404" => [
+ "TITLE" => "错误 404: 页面丢失",
+ "DESCRIPTION" => "我们无法找到你想要的东西.",
+ "DETAIL" => "我们正努力寻找网页...",
+ "EXPLAIN" => "我们无法找到你想要的网页.",
+ "RETURN" => '不管怎样, 点击 这里 返回前一页.'
+ ],
+
+ "CONFIG" => [
+ "TITLE" => "UserFrosting 配置问题!",
+ "DESCRIPTION" => "一些 UserFrosting 配置要求没有达到.",
+ "DETAIL" => "这里有些东西不正确.",
+ "RETURN" => '请更正如下问题, 然后 重新加载 .'
+ ],
+
+ "DESCRIPTION" => "我们发现一股强力干扰.",
+ "DETAIL" => "下面是我们得到的信息:",
+
+ "ENCOUNTERED" => "嗯...发生了一些情况. 然而我们并不知道这是什么.",
+
+ "RETURN" => '点击 返回上一页.',
+
+ "SERVER" => "哦, 看起来我们的服务器出错了. 如果你是管理员, 请检查PHP及UF的logs.",
+
+ "TITLE" => "强力干扰"
+ ]
+];
diff --git a/login/app/sprinkles/core/locale/zh_CN/messages.php b/login/app/sprinkles/core/locale/zh_CN/messages.php
new file mode 100755
index 0000000..55e769a
--- /dev/null
+++ b/login/app/sprinkles/core/locale/zh_CN/messages.php
@@ -0,0 +1,105 @@
+ 0,
+
+ "ABOUT" => "关于",
+
+ "CAPTCHA" => [
+ "@TRANSLATION" => "验证码",
+ "FAIL" => "Y验证码输入错误.",
+ "SPECIFY" => "输入验证码",
+ "VERIFY" => "验证"
+ ],
+
+ "CSRF_MISSING" => " CSRF 标记丢失. 请尝试重新加载页面?",
+
+ "DB_INVALID" => "无法连接到数据库. 如果你是管理员, 请检查错误日志文件.",
+ "DESCRIPTION" => "描述",
+ "DOWNLOAD" => [
+ "@TRANSLATION" => "下载",
+ "CSV" => "下载 CSV 文件"
+ ],
+
+ "EMAIL" => [
+ "@TRANSLATION" => "邮件",
+ "YOUR" => "你的邮件地址"
+ ],
+
+ "HOME" => "首页",
+
+ "LEGAL" => "法律政策",
+
+ "LOCALE" => [
+ "@TRANSLATION" => "本地"
+ ],
+
+ "MAIL_ERROR" => "尝试发送邮件发送致命错误, 联系网站管理员. 如果你是管理员,请检查UF邮件错误日志.",
+
+ "NAME" => "名字",
+ "NAVIGATION" => "导航",
+
+ "PAGINATION" => [
+ "GOTO" => "跳到页",
+ "SHOW" => "显示"
+ ],
+ "PRIVACY" => "隐私政策",
+
+ "SLUG" => "Slug",
+ "SLUG_CONDITION" => "Slug/Conditions",
+ "SLUG_IN_USE" => "A {{slug}} slug already exists",
+ "STATUS" => "状态",
+ "SUGGEST" => "建议",
+
+ "UNKNOWN" => "未知",
+
+ // Actions words
+ "ACTIONS" => "动作",
+ "ACTIVATE" => "激活",
+ "ACTIVE" => "Active",
+ "ADD" => "添加",
+ "CANCEL" => "取消",
+ "CONFIRM" => "确认",
+ "CREATE" => "创建",
+ "DELETE" => "删除",
+ "DELETE_CONFIRM" => "你确定要删除这个?",
+ "DELETE_CONFIRM_YES" => "是的, 删除",
+ "DELETE_CONFIRM_NAMED" => "你确定要删除 {{name}}?",
+ "DELETE_CONFIRM_YES_NAMED" => "是的, 删除 {{name}}",
+ "DELETE_CANNOT_UNDONE" => "这个动作无法撤销.",
+ "DELETE_NAMED" => "删除 {{name}}",
+ "DENY" => "拒绝",
+ "DISABLE" => "禁用",
+ "DISABLED" => "禁用",
+ "EDIT" => "编辑",
+ "ENABLE" => "启用",
+ "ENABLED" => "启用",
+ "OVERRIDE" => "覆盖",
+ "RESET" => "重置",
+ "SAVE" => "保存",
+ "SEARCH" => "搜寻",
+ "SORT" => "排序",
+ "SUBMIT" => "提交",
+ "PRINT" => "打印",
+ "REMOVE" => "删除",
+ "UNACTIVATED" => "未激活",
+ "UPDATE" => "更新",
+ "YES" => "是",
+ "NO" => "不是",
+ "OPTIONAL" => "可选择的",
+
+ // Misc.
+ "BUILT_WITH_UF" => "使用 UserFrosting ",
+ "ADMINLTE_THEME_BY" => "主题作者 Almsaeed Studio . 保留所有权"
+];
diff --git a/login/app/sprinkles/core/locale/zh_CN/validate.php b/login/app/sprinkles/core/locale/zh_CN/validate.php
new file mode 100755
index 0000000..ed68198
--- /dev/null
+++ b/login/app/sprinkles/core/locale/zh_CN/validate.php
@@ -0,0 +1,29 @@
+ [
+ "ARRAY" => " {{label}} 的值必须在一个数组中.",
+ "BOOLEAN" => " {{label}} 的值必须是 '0' 或 '1'.",
+ "INTEGER" => " {{label}} 必须是整数.",
+ "INVALID_EMAIL" => "无效的邮箱地址.",
+ "LENGTH_RANGE" => "{{label}} 的长度必须在 {{min}} - {{max}} 之间.",
+ "NO_LEAD_WS" => "{{label}} 的值不能以空格、TAB或其他空白开始.",
+ "NO_TRAIL_WS" => " {{label}} 的值不能以空格、TAB或其他空白结束.",
+ "REQUIRED" => "请为 {{label}} 确定一个值.",
+ "SPRUNJE" => [
+ "BAD_FILTER" => "{{name}} 不是一个有效的 Sprunje 过滤器.",
+ "BAD_SORT" => "{{name}} 不是一个有效的 Sprunje 排序."
+ ]
+ ]
+];
diff --git a/login/app/sprinkles/core/routes/routes.php b/login/app/sprinkles/core/routes/routes.php
new file mode 100755
index 0000000..3598b7e
--- /dev/null
+++ b/login/app/sprinkles/core/routes/routes.php
@@ -0,0 +1,24 @@
+getContainer()->get('config');
+
+$app->get('/', 'UserFrosting\Sprinkle\Core\Controller\CoreController:pageIndex')
+ ->add('checkEnvironment')
+ ->setName('index');
+
+$app->get('/about','UserFrosting\Sprinkle\Core\Controller\CoreController:pageAbout')->add('checkEnvironment');
+
+$app->get('/alerts', 'UserFrosting\Sprinkle\Core\Controller\CoreController:jsonAlerts');
+
+$app->get('/legal', 'UserFrosting\Sprinkle\Core\Controller\CoreController:pageLegal');
+
+$app->get('/privacy', 'UserFrosting\Sprinkle\Core\Controller\CoreController:pagePrivacy');
+
+$app->get('/' . $config['assets.raw.path'] . '/{url:.+}', 'UserFrosting\Sprinkle\Core\Controller\CoreController:getAsset');
diff --git a/login/app/sprinkles/core/schema/.gitkeep b/login/app/sprinkles/core/schema/.gitkeep
new file mode 100755
index 0000000..e69de29
diff --git a/login/app/sprinkles/core/src/Alert/AlertStream.php b/login/app/sprinkles/core/src/Alert/AlertStream.php
new file mode 100755
index 0000000..3946cbf
--- /dev/null
+++ b/login/app/sprinkles/core/src/Alert/AlertStream.php
@@ -0,0 +1,144 @@
+messagesKey = $messagesKey;
+
+ $this->setTranslator($translator);
+ }
+
+ /**
+ * Set the translator to be used for all message streams. Must be done before `addMessageTranslated` can be used.
+ *
+ * @param UserFrosting\I18n\MessageTranslator $translator A MessageTranslator to be used to translate messages when added via `addMessageTranslated`.
+ */
+ public function setTranslator($translator)
+ {
+ $this->messageTranslator = $translator;
+ return $this;
+ }
+
+ /**
+ * Adds a raw text message to the cache message stream.
+ *
+ * @param string $type The type of message, indicating how it will be styled when outputted. Should be set to "success", "danger", "warning", or "info".
+ * @param string $message The message to be added to the message stream.
+ * @return MessageStream this MessageStream object.
+ */
+ public function addMessage($type, $message)
+ {
+ $messages = $this->messages();
+ $messages[] = array(
+ "type" => $type,
+ "message" => $message
+ );
+ $this->saveMessages($messages);
+ return $this;
+ }
+
+ /**
+ * Adds a text message to the cache message stream, translated into the currently selected language.
+ *
+ * @param string $type The type of message, indicating how it will be styled when outputted. Should be set to "success", "danger", "warning", or "info".
+ * @param string $messageId The message id for the message to be added to the message stream.
+ * @param array[string] $placeholders An optional hash of placeholder names => placeholder values to substitute into the translated message.
+ * @return MessageStream this MessageStream object.
+ */
+ public function addMessageTranslated($type, $messageId, $placeholders = array())
+ {
+ if (!$this->messageTranslator){
+ throw new \RuntimeException("No translator has been set! Please call MessageStream::setTranslator first.");
+ }
+
+ $message = $this->messageTranslator->translate($messageId, $placeholders);
+ return $this->addMessage($type, $message);
+ }
+
+ /**
+ * Get the messages and then clear the message stream.
+ * This function does the same thing as `messages()`, except that it also clears all messages afterwards.
+ * This is useful, because typically we don't want to view the same messages more than once.
+ *
+ * @return array An array of messages, each of which is itself an array containing "type" and "message" fields.
+ */
+ public function getAndClearMessages()
+ {
+ $messages = $this->messages();
+ $this->resetMessageStream();
+ return $messages;
+ }
+
+ /**
+ * Add error messages from a ServerSideValidator object to the message stream.
+ *
+ * @param ServerSideValidator $validator
+ */
+ public function addValidationErrors(ServerSideValidator $validator)
+ {
+ foreach ($validator->errors() as $idx => $field) {
+ foreach($field as $eidx => $error) {
+ $this->addMessage("danger", $error);
+ }
+ }
+ }
+
+ /**
+ * Return the translator for this message stream.
+ *
+ * @return MessageTranslator The translator for this message stream.
+ */
+ public function translator()
+ {
+ return $this->messageTranslator;
+ }
+
+ /**
+ * Get the messages from this message stream.
+ *
+ * @return array An array of messages, each of which is itself an array containing "type" and "message" fields.
+ */
+ abstract public function messages();
+
+ /**
+ * Clear all messages from this message stream.
+ */
+ abstract public function resetMessageStream();
+
+ /**
+ * Save messages to the stream
+ */
+ abstract protected function saveMessages($message);
+}
diff --git a/login/app/sprinkles/core/src/Alert/CacheAlertStream.php b/login/app/sprinkles/core/src/Alert/CacheAlertStream.php
new file mode 100755
index 0000000..1fd5131
--- /dev/null
+++ b/login/app/sprinkles/core/src/Alert/CacheAlertStream.php
@@ -0,0 +1,84 @@
+cache = $cache;
+ $this->config = $config;
+ parent::__construct($messagesKey, $translator);
+ }
+
+ /**
+ * Get the messages from this message stream.
+ *
+ * @return array An array of messages, each of which is itself an array containing 'type' and 'message' fields.
+ */
+ public function messages()
+ {
+ if ($this->cache->tags('_s'.session_id())->has($this->messagesKey)) {
+ return $this->cache->tags('_s'.session_id())->get($this->messagesKey) ?: [];
+ } else {
+ return [];
+ }
+ }
+
+ /**
+ * Clear all messages from this message stream.
+ *
+ * @return void
+ */
+ public function resetMessageStream()
+ {
+ $this->cache->tags('_s'.session_id())->forget($this->messagesKey);
+ }
+
+ /**
+ * Save messages to the stream
+ *
+ * @param string $messages The message
+ * @return void
+ */
+ protected function saveMessages($messages)
+ {
+ $this->cache->tags('_s'.session_id())->forever($this->messagesKey, $messages);
+ }
+}
diff --git a/login/app/sprinkles/core/src/Alert/SessionAlertStream.php b/login/app/sprinkles/core/src/Alert/SessionAlertStream.php
new file mode 100755
index 0000000..8b4604b
--- /dev/null
+++ b/login/app/sprinkles/core/src/Alert/SessionAlertStream.php
@@ -0,0 +1,70 @@
+session = $session;
+ parent::__construct($messagesKey, $translator);
+ }
+
+ /**
+ * Get the messages from this message stream.
+ *
+ * @return array An array of messages, each of which is itself an array containing "type" and "message" fields.
+ */
+ public function messages()
+ {
+ return $this->session[$this->messagesKey] ?: [];
+ }
+
+ /**
+ * Clear all messages from this message stream.
+ *
+ * @return void
+ */
+ public function resetMessageStream()
+ {
+ $this->session[$this->messagesKey] = [];
+ }
+
+ /**
+ * Save messages to the stream
+ *
+ * @param string $messages The message
+ * @return void
+ */
+ protected function saveMessages($messages)
+ {
+ $this->session[$this->messagesKey] = $messages;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Controller/CoreController.php b/login/app/sprinkles/core/src/Controller/CoreController.php
new file mode 100755
index 0000000..0dd8165
--- /dev/null
+++ b/login/app/sprinkles/core/src/Controller/CoreController.php
@@ -0,0 +1,95 @@
+ci->view->render($response, 'pages/index.html.twig');
+ }
+
+ /**
+ * Renders a sample "about" page for UserFrosting.
+ *
+ * Request type: GET
+ */
+ public function pageAbout($request, $response, $args)
+ {
+ return $this->ci->view->render($response, 'pages/about.html.twig');
+ }
+
+ /**
+ * Renders terms of service page.
+ *
+ * Request type: GET
+ */
+ public function pageLegal($request, $response, $args)
+ {
+ return $this->ci->view->render($response, 'pages/legal.html.twig');
+ }
+
+ /**
+ * Renders privacy page.
+ *
+ * Request type: GET
+ */
+ public function pagePrivacy($request, $response, $args)
+ {
+ return $this->ci->view->render($response, 'pages/privacy.html.twig');
+ }
+
+ /**
+ * Render the alert stream as a JSON object.
+ *
+ * The alert stream contains messages which have been generated by calls to `MessageStream::addMessage` and `MessageStream::addMessageTranslated`.
+ * Request type: GET
+ */
+ public function jsonAlerts($request, $response, $args)
+ {
+ return $response->withJson($this->ci->alerts->getAndClearMessages());
+ }
+
+ /**
+ * Handle all requests for raw assets.
+ * Request type: GET
+ */
+ public function getAsset($request, $response, $args)
+ {
+ // By starting this service, we ensure that the timezone gets set.
+ $config = $this->ci->config;
+
+ $assetLoader = $this->ci->assetLoader;
+
+ if (!$assetLoader->loadAsset($args['url'])) {
+ throw new NotFoundException($request, $response);
+ }
+
+ return $response
+ ->withHeader('Content-Type', $assetLoader->getType())
+ ->withHeader('Content-Length', $assetLoader->getLength())
+ ->write($assetLoader->getContent());
+ }
+}
diff --git a/login/app/sprinkles/core/src/Controller/SimpleController.php b/login/app/sprinkles/core/src/Controller/SimpleController.php
new file mode 100755
index 0000000..b0fc152
--- /dev/null
+++ b/login/app/sprinkles/core/src/Controller/SimpleController.php
@@ -0,0 +1,36 @@
+ci = $ci;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Core.php b/login/app/sprinkles/core/src/Core.php
new file mode 100755
index 0000000..d7e1dcb
--- /dev/null
+++ b/login/app/sprinkles/core/src/Core.php
@@ -0,0 +1,121 @@
+ ['onSprinklesInitialized', 0],
+ 'onSprinklesRegisterServices' => ['onSprinklesRegisterServices', 0],
+ 'onAddGlobalMiddleware' => ['onAddGlobalMiddleware', 0]
+ ];
+ }
+
+ /**
+ * Set static references to DI container in necessary classes.
+ */
+ public function onSprinklesInitialized()
+ {
+ // Set container for data model
+ Model::$ci = $this->ci;
+
+ // Set container for environment info class
+ EnvironmentInfo::$ci = $this->ci;
+ }
+
+ /**
+ * Get shutdownHandler set up. This needs to be constructed explicitly because it's invoked natively by PHP.
+ */
+ public function onSprinklesRegisterServices()
+ {
+ // Set up any global PHP settings from the config service.
+ $config = $this->ci->config;
+
+ // Display PHP fatal errors natively.
+ if (isset($config['php.display_errors_native'])) {
+ ini_set('display_errors', $config['php.display_errors_native']);
+ }
+
+ // Log PHP fatal errors
+ if (isset($config['php.log_errors'])) {
+ ini_set('log_errors', $config['php.log_errors']);
+ }
+
+ // Configure error-reporting level
+ if (isset($config['php.error_reporting'])) {
+ error_reporting($config['php.error_reporting']);
+ }
+
+ // Configure time zone
+ if (isset($config['php.timezone'])) {
+ date_default_timezone_set($config['php.timezone']);
+ }
+
+ // Determine if error display is enabled in the shutdown handler.
+ $displayErrors = false;
+ if (in_array(strtolower($config['php.display_errors']), [
+ '1',
+ 'on',
+ 'true',
+ 'yes'
+ ])) {
+ $displayErrors = true;
+ }
+
+ $sh = new ShutdownHandler($this->ci, $displayErrors);
+ $sh->register();
+ }
+
+ /**
+ * Add CSRF middleware.
+ */
+ public function onAddGlobalMiddleware(Event $event)
+ {
+ $request = $this->ci->request;
+ $path = $request->getUri()->getPath();
+ $method = $request->getMethod();
+
+ // Normalize path to always have a leading slash
+ $path = '/' . ltrim($path, '/');
+ // Normalize method to uppercase
+ $method = strtoupper($method);
+
+ $csrfBlacklist = $this->ci->config['csrf.blacklist'];
+ $isBlacklisted = false;
+
+ // Go through the blacklist and determine if the path and method match any of the blacklist entries.
+ foreach ($csrfBlacklist as $pattern => $methods) {
+ $methods = array_map('strtoupper', (array) $methods);
+ if (in_array($method, $methods) && $pattern != '' && preg_match('~' . $pattern . '~', $path)) {
+ $isBlacklisted = true;
+ break;
+ }
+ }
+
+ if (!$path || !$isBlacklisted) {
+ $app = $event->getApp();
+ $app->add($this->ci->csrf);
+ }
+ }
+}
diff --git a/login/app/sprinkles/core/src/Database/Builder.php b/login/app/sprinkles/core/src/Database/Builder.php
new file mode 100755
index 0000000..8e27b7c
--- /dev/null
+++ b/login/app/sprinkles/core/src/Database/Builder.php
@@ -0,0 +1,210 @@
+where($field, 'LIKE', "$value%");
+ }
+
+ /**
+ * Perform an "ends with" pattern match on a specified column in a query.
+ *
+ * @param $query
+ * @param $field string The column to match
+ * @param $value string The value to match
+ */
+ public function endsWith($field, $value)
+ {
+ return $this->where($field, 'LIKE', "%$value");
+ }
+
+ /**
+ * Add columns to be excluded from the query.
+ *
+ * @param $value array|string The column(s) to exclude
+ * @return $this
+ */
+ public function exclude($column)
+ {
+ $column = is_array($column) ? $column : func_get_args();
+
+ $this->excludedColumns = array_merge((array) $this->excludedColumns, $column);
+
+ return $this;
+ }
+
+ /**
+ * Perform a pattern match on a specified column in a query.
+ * @param $query
+ * @param $field string The column to match
+ * @param $value string The value to match
+ */
+ public function like($field, $value)
+ {
+ return $this->where($field, 'LIKE', "%$value%");
+ }
+
+ /**
+ * Perform a pattern match on a specified column in a query.
+ * @param $query
+ * @param $field string The column to match
+ * @param $value string The value to match
+ */
+ public function orLike($field, $value)
+ {
+ return $this->orWhere($field, 'LIKE', "%$value%");
+ }
+
+ /**
+ * Execute the query as a "select" statement.
+ *
+ * @param array $columns
+ * @return \Illuminate\Support\Collection
+ */
+ public function get($columns = ['*'])
+ {
+ $original = $this->columns;
+
+ if (is_null($original)) {
+ $this->columns = $columns;
+ }
+
+ // Exclude any explicitly excluded columns
+ if (!is_null($this->excludedColumns)) {
+ $this->removeExcludedSelectColumns();
+ }
+
+ $results = $this->processor->processSelect($this, $this->runSelect());
+
+ $this->columns = $original;
+
+ return collect($results);
+ }
+
+ /**
+ * Remove excluded columns from the select column list.
+ */
+ protected function removeExcludedSelectColumns()
+ {
+ // Convert current column list and excluded column list to fully-qualified list
+ $this->columns = $this->convertColumnsToFullyQualified($this->columns);
+ $excludedColumns = $this->convertColumnsToFullyQualified($this->excludedColumns);
+
+ // Remove any explicitly referenced excludable columns
+ $this->columns = array_diff($this->columns, $excludedColumns);
+
+ // Replace any remaining wildcard columns (*, table.*, etc) with a list
+ // of fully-qualified column names
+ $this->columns = $this->replaceWildcardColumns($this->columns);
+
+ $this->columns = array_diff($this->columns, $excludedColumns);
+ }
+
+ /**
+ * Find any wildcard columns ('*'), remove it from the column list and replace with an explicit list of columns.
+ *
+ * @param array $columns
+ * @return array
+ */
+ protected function replaceWildcardColumns(array $columns)
+ {
+ $wildcardTables = $this->findWildcardTables($columns);
+
+ foreach ($wildcardTables as $wildColumn => $table) {
+ $schemaColumns = $this->getQualifiedColumnNames($table);
+
+ // Remove the `*` or `.*` column and replace with the individual schema columns
+ $columns = array_diff($columns, [$wildColumn]);
+ $columns = array_merge($columns, $schemaColumns);
+ }
+
+ return $columns;
+ }
+
+ /**
+ * Return a list of wildcard columns from the list of columns, mapping columns to their corresponding tables.
+ *
+ * @param array $columns
+ * @return array
+ */
+ protected function findWildcardTables(array $columns)
+ {
+ $tables = [];
+
+ foreach ($columns as $column) {
+ if ($column == '*') {
+ $tables[$column] = $this->from;
+ continue;
+ }
+
+ if (substr($column, -1) == '*') {
+ $tableName = explode('.', $column)[0];
+ if ($tableName) {
+ $tables[$column] = $tableName;
+ }
+ }
+ }
+
+ return $tables;
+ }
+
+ /**
+ * Gets the fully qualified column names for a specified table.
+ *
+ * @param string $table
+ * @return array
+ */
+ protected function getQualifiedColumnNames($table = null)
+ {
+ $schema = $this->getConnection()->getSchemaBuilder();
+
+ return $this->convertColumnsToFullyQualified($schema->getColumnListing($table), $table);
+ }
+
+ /**
+ * Fully qualify any unqualified columns in a list with this builder's table name.
+ *
+ * @param array $columns
+ * @return array
+ */
+ protected function convertColumnsToFullyQualified($columns, $table = null)
+ {
+ if (is_null($table)) {
+ $table = $this->from;
+ }
+
+ array_walk($columns, function (&$item, $key) use ($table) {
+ if (strpos($item, '.') === false) {
+ $item = "$table.$item";
+ }
+ });
+
+ return $columns;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Database/DatabaseInvalidException.php b/login/app/sprinkles/core/src/Database/DatabaseInvalidException.php
new file mode 100755
index 0000000..08f8a31
--- /dev/null
+++ b/login/app/sprinkles/core/src/Database/DatabaseInvalidException.php
@@ -0,0 +1,20 @@
+schema->hasTable('sessions')) {
+ $this->schema->create('sessions', function (Blueprint $table) {
+ $table->string('id')->unique();
+ $table->integer('user_id')->nullable();
+ $table->string('ip_address', 45)->nullable();
+ $table->text('user_agent')->nullable();
+ $table->text('payload');
+ $table->integer('last_activity');
+ });
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function down()
+ {
+ $this->schema->drop('sessions');
+ }
+}
diff --git a/login/app/sprinkles/core/src/Database/Migrations/v400/ThrottlesTable.php b/login/app/sprinkles/core/src/Database/Migrations/v400/ThrottlesTable.php
new file mode 100755
index 0000000..1c742f7
--- /dev/null
+++ b/login/app/sprinkles/core/src/Database/Migrations/v400/ThrottlesTable.php
@@ -0,0 +1,52 @@
+schema->hasTable('throttles')) {
+ $this->schema->create('throttles', function (Blueprint $table) {
+ $table->increments('id');
+ $table->string('type');
+ $table->string('ip')->nullable();
+ $table->text('request_data')->nullable();
+ $table->timestamps();
+
+ $table->engine = 'InnoDB';
+ $table->collation = 'utf8_unicode_ci';
+ $table->charset = 'utf8';
+ $table->index('type');
+ $table->index('ip');
+ });
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function down()
+ {
+ $this->schema->drop('throttles');
+ }
+}
diff --git a/login/app/sprinkles/core/src/Database/Models/Concerns/HasRelationships.php b/login/app/sprinkles/core/src/Database/Models/Concerns/HasRelationships.php
new file mode 100755
index 0000000..4fe9a30
--- /dev/null
+++ b/login/app/sprinkles/core/src/Database/Models/Concerns/HasRelationships.php
@@ -0,0 +1,278 @@
+newRelatedInstance($related);
+
+ $foreignKey = $foreignKey ?: $this->getForeignKey();
+
+ $localKey = $localKey ?: $this->getKeyName();
+
+ return new HasManySyncable(
+ $instance->newQuery(), $this, $instance->getTable().'.'.$foreignKey, $localKey
+ );
+ }
+
+ /**
+ * Overrides the default Eloquent morphMany relationship to return a MorphManySyncable.
+ *
+ * {@inheritDoc}
+ * @return \UserFrosting\Sprinkle\Core\Database\Relations\MorphManySyncable
+ */
+ public function morphMany($related, $name, $type = null, $id = null, $localKey = null)
+ {
+ $instance = $this->newRelatedInstance($related);
+
+ // Here we will gather up the morph type and ID for the relationship so that we
+ // can properly query the intermediate table of a relation. Finally, we will
+ // get the table and create the relationship instances for the developers.
+ list($type, $id) = $this->getMorphs($name, $type, $id);
+ $table = $instance->getTable();
+ $localKey = $localKey ?: $this->getKeyName();
+
+ return new MorphManySyncable($instance->newQuery(), $this, $table.'.'.$type, $table.'.'.$id, $localKey);
+ }
+
+ /**
+ * Define a many-to-many 'through' relationship.
+ * This is basically hasManyThrough for many-to-many relationships.
+ *
+ * @param string $related
+ * @param string $through
+ * @param string $firstJoiningTable
+ * @param string $firstForeignKey
+ * @param string $firstRelatedKey
+ * @param string $secondJoiningTable
+ * @param string $secondForeignKey
+ * @param string $secondRelatedKey
+ * @param string $throughRelation
+ * @param string $relation
+ * @return \UserFrosting\Sprinkle\Core\Database\Relations\BelongsToManyThrough
+ */
+ public function belongsToManyThrough(
+ $related,
+ $through,
+ $firstJoiningTable = null,
+ $firstForeignKey = null,
+ $firstRelatedKey = null,
+ $secondJoiningTable = null,
+ $secondForeignKey = null,
+ $secondRelatedKey = null,
+ $throughRelation = null,
+ $relation = null
+ )
+ {
+ // If no relationship name was passed, we will pull backtraces to get the
+ // name of the calling function. We will use that function name as the
+ // title of this relation since that is a great convention to apply.
+ if (is_null($relation)) {
+ $relation = $this->guessBelongsToManyRelation();
+ }
+
+ // Create models for through and related
+ $through = new $through;
+ $related = $this->newRelatedInstance($related);
+
+ if (is_null($throughRelation)) {
+ $throughRelation = $through->getTable();
+ }
+
+ // If no table names were provided, we can guess it by concatenating the parent
+ // and through table names. The two model names are transformed to snake case
+ // from their default CamelCase also.
+ if (is_null($firstJoiningTable)) {
+ $firstJoiningTable = $this->joiningTable($through);
+ }
+
+ if (is_null($secondJoiningTable)) {
+ $secondJoiningTable = $through->joiningTable($related);
+ }
+
+ $firstForeignKey = $firstForeignKey ?: $this->getForeignKey();
+ $firstRelatedKey = $firstRelatedKey ?: $through->getForeignKey();
+ $secondForeignKey = $secondForeignKey ?: $through->getForeignKey();
+ $secondRelatedKey = $secondRelatedKey ?: $related->getForeignKey();
+
+ // This relationship maps the top model (this) to the through model.
+ $intermediateRelationship = $this->belongsToMany($through, $firstJoiningTable, $firstForeignKey, $firstRelatedKey, $throughRelation)
+ ->withPivot($firstForeignKey);
+
+ // Now we set up the relationship with the related model.
+ $query = new BelongsToManyThrough(
+ $related->newQuery(), $this, $intermediateRelationship, $secondJoiningTable, $secondForeignKey, $secondRelatedKey, $relation
+ );
+
+ return $query;
+ }
+
+ /**
+ * Define a unique many-to-many relationship. Similar to a regular many-to-many relationship, but removes duplicate child objects.
+ * Can also be used to implement ternary relationships.
+ *
+ * {@inheritDoc}
+ * @return \UserFrosting\Sprinkle\Core\Database\Relations\BelongsToManyUnique
+ */
+ public function belongsToManyUnique($related, $table = null, $foreignKey = null, $relatedKey = null, $relation = null)
+ {
+ // If no relationship name was passed, we will pull backtraces to get the
+ // name of the calling function. We will use that function name as the
+ // title of this relation since that is a great convention to apply.
+ if (is_null($relation)) {
+ $relation = $this->guessBelongsToManyRelation();
+ }
+
+ // First, we'll need to determine the foreign key and "other key" for the
+ // relationship. Once we have determined the keys we'll make the query
+ // instances as well as the relationship instances we need for this.
+ $instance = $this->newRelatedInstance($related);
+
+ $foreignKey = $foreignKey ?: $this->getForeignKey();
+
+ $relatedKey = $relatedKey ?: $instance->getForeignKey();
+
+ // If no table name was provided, we can guess it by concatenating the two
+ // models using underscores in alphabetical order. The two model names
+ // are transformed to snake case from their default CamelCase also.
+ if (is_null($table)) {
+ $table = $this->joiningTable($related);
+ }
+
+ return new BelongsToManyUnique(
+ $instance->newQuery(), $this, $table, $foreignKey, $relatedKey, $relation
+ );
+ }
+
+ /**
+ * Define a unique morphs-to-many relationship. Similar to a regular morphs-to-many relationship, but removes duplicate child objects.
+ *
+ * {@inheritDoc}
+ * @return \UserFrosting\Sprinkle\Core\Database\Relations\MorphToManyUnique
+ */
+ public function morphToManyUnique($related, $name, $table = null, $foreignKey = null, $otherKey = null, $inverse = false)
+ {
+ $caller = $this->getBelongsToManyCaller();
+
+ // First, we will need to determine the foreign key and "other key" for the
+ // relationship. Once we have determined the keys we will make the query
+ // instances, as well as the relationship instances we need for these.
+ $foreignKey = $foreignKey ?: $name.'_id';
+
+ $instance = new $related;
+
+ $otherKey = $otherKey ?: $instance->getForeignKey();
+
+ // Now we're ready to create a new query builder for this related model and
+ // the relationship instances for this relation. This relations will set
+ // appropriate query constraints then entirely manages the hydrations.
+ $query = $instance->newQuery();
+
+ $table = $table ?: Str::plural($name);
+
+ return new MorphToManyUnique(
+ $query, $this, $name, $table, $foreignKey,
+ $otherKey, $caller, $inverse
+ );
+ }
+
+ /**
+ * Define a constrained many-to-many relationship.
+ * This is similar to a regular many-to-many, but constrains the child results to match an additional constraint key in the parent object.
+ * This has been superseded by the belongsToManyUnique relationship's `withTernary` method since 4.1.7.
+ *
+ * @deprecated since 4.1.6
+ * @param string $related
+ * @param string $constraintKey
+ * @param string $table
+ * @param string $foreignKey
+ * @param string $relatedKey
+ * @param string $relation
+ * @return \UserFrosting\Sprinkle\Core\Database\Relations\BelongsToManyConstrained
+ */
+ public function belongsToManyConstrained($related, $constraintKey, $table = null, $foreignKey = null, $relatedKey = null, $relation = null)
+ {
+ // If no relationship name was passed, we will pull backtraces to get the
+ // name of the calling function. We will use that function name as the
+ // title of this relation since that is a great convention to apply.
+ if (is_null($relation)) {
+ $relation = $this->guessBelongsToManyRelation();
+ }
+
+ // First, we'll need to determine the foreign key and "other key" for the
+ // relationship. Once we have determined the keys we'll make the query
+ // instances as well as the relationship instances we need for this.
+ $instance = $this->newRelatedInstance($related);
+
+ $foreignKey = $foreignKey ?: $this->getForeignKey();
+
+ $relatedKey = $relatedKey ?: $instance->getForeignKey();
+
+ // If no table name was provided, we can guess it by concatenating the two
+ // models using underscores in alphabetical order. The two model names
+ // are transformed to snake case from their default CamelCase also.
+ if (is_null($table)) {
+ $table = $this->joiningTable($related);
+ }
+
+ return new BelongsToManyConstrained(
+ $instance->newQuery(), $this, $constraintKey, $table, $foreignKey, $relatedKey, $relation
+ );
+ }
+
+ /**
+ * Get the relationship name of the belongs to many.
+ *
+ * @return string
+ */
+ protected function getBelongsToManyCaller()
+ {
+ $self = __FUNCTION__;
+
+ $caller = Arr::first(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), function ($key, $trace) use ($self) {
+ $caller = $trace['function'];
+ return ! in_array($caller, HasRelationships::$manyMethodsExtended) && $caller != $self;
+ });
+
+ return ! is_null($caller) ? $caller['function'] : null;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Database/Models/Model.php b/login/app/sprinkles/core/src/Database/Models/Model.php
new file mode 100755
index 0000000..1c18c2c
--- /dev/null
+++ b/login/app/sprinkles/core/src/Database/Models/Model.php
@@ -0,0 +1,140 @@
+attributes);
+ }
+
+ /**
+ * Determines whether a model exists by checking a unique column, including checking soft-deleted records
+ *
+ * @param mixed $value
+ * @param string $identifier
+ * @param bool $checkDeleted set to true to include soft-deleted records
+ * @return \UserFrosting\Sprinkle\Core\Database\Models\Model|null
+ */
+ public static function findUnique($value, $identifier, $checkDeleted = true)
+ {
+ $query = static::where($identifier, $value);
+
+ if ($checkDeleted) {
+ $query = $query->withTrashed();
+ }
+
+ return $query->first();
+ }
+
+ /**
+ * Determine if an relation exists on the model - even if it is null.
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function relationExists($key)
+ {
+ return array_key_exists($key, $this->relations);
+ }
+
+ /**
+ * Store the object in the DB, creating a new row if one doesn't already exist.
+ *
+ * Calls save(), then returns the id of the new record in the database.
+ * @return int the id of this object.
+ */
+ public function store()
+ {
+ $this->save();
+
+ // Store function should always return the id of the object
+ return $this->id;
+ }
+
+ /**
+ * Overrides Laravel's base Model to return our custom query builder object.
+ *
+ * @return \UserFrosting\Sprinkles\Core\Database\Builder
+ */
+ protected function newBaseQueryBuilder()
+ {
+ /** @var UserFrosting\Sprinkle\Core\Util\ClassMapper $classMapper */
+ $classMapper = static::$ci->classMapper;
+
+ $connection = $this->getConnection();
+
+ return $classMapper->createInstance(
+ 'query_builder',
+ $connection,
+ $connection->getQueryGrammar(),
+ $connection->getPostProcessor()
+ );
+ }
+
+ /**
+ * Get the properties of this object as an associative array. Alias for toArray().
+ *
+ * @deprecated since 4.1.8 There is no point in having this alias.
+ * @return array
+ */
+ public function export()
+ {
+ return $this->toArray();
+ }
+
+ /**
+ * For raw array fetching. Must be static, otherwise PHP gets confused about where to find $table.
+ *
+ * @deprecated since 4.1.8 setFetchMode is no longer available as of Laravel 5.4.
+ * @link https://github.com/laravel/framework/issues/17728
+ */
+ public static function queryBuilder()
+ {
+ // Set query builder to fetch result sets as associative arrays (instead of creating stdClass objects)
+ DB::connection()->setFetchMode(\PDO::FETCH_ASSOC);
+ return DB::table(static::$table);
+ }
+}
diff --git a/login/app/sprinkles/core/src/Database/Models/Throttle.php b/login/app/sprinkles/core/src/Database/Models/Throttle.php
new file mode 100755
index 0000000..d13a7c1
--- /dev/null
+++ b/login/app/sprinkles/core/src/Database/Models/Throttle.php
@@ -0,0 +1,36 @@
+constraintKey = $constraintKey;
+ parent::__construct($query, $parent, $table, $foreignKey, $relatedKey, $relationName);
+ }
+
+ /**
+ * Set the constraints for an eager load of the relation.
+ *
+ * @param array $models
+ * @return void
+ */
+ public function addEagerConstraints(array $models)
+ {
+ // To make the query more efficient, we only bother querying related models if their pivot key value
+ // matches the pivot key value of one of the parent models.
+ $pivotKeys = $this->getPivotKeys($models, $this->constraintKey);
+ $this->query->whereIn($this->getQualifiedForeignKeyName(), $this->getKeys($models))
+ ->whereIn($this->constraintKey, $pivotKeys);
+ }
+
+ /**
+ * Gets a list of unique pivot key values from an array of models.
+ */
+ protected function getPivotKeys(array $models, $pivotKey)
+ {
+ $pivotKeys = [];
+ foreach ($models as $model) {
+ $pivotKeys[] = $model->getRelation('pivot')->{$pivotKey};
+ }
+ return array_unique($pivotKeys);
+ }
+
+ /**
+ * Match the eagerly loaded results to their parents, constraining the results by matching the values of $constraintKey
+ * in the parent object to the child objects.
+ *
+ * @link Called in https://github.com/laravel/framework/blob/2f4135d8db5ded851d1f4f611124c53b768a3c08/src/Illuminate/Database/Eloquent/Builder.php
+ * @param array $models
+ * @param \Illuminate\Database\Eloquent\Collection $results
+ * @param string $relation
+ * @return array
+ */
+ public function match(array $models, Collection $results, $relation)
+ {
+ $dictionary = $this->buildDictionary($results);
+
+ // Once we have an array dictionary of child objects we can easily match the
+ // children back to their parent using the dictionary and the keys on the
+ // the parent models. Then we will return the hydrated models back out.
+ foreach ($models as $model) {
+ $pivotValue = $model->getRelation('pivot')->{$this->constraintKey};
+ if (isset($dictionary[$key = $model->getKey()])) {
+ // Only match children if their pivot key value matches that of the parent model
+ $items = $this->findMatchingPivots($dictionary[$key], $pivotValue);
+ $model->setRelation(
+ $relation, $this->related->newCollection($items)
+ );
+ }
+ }
+
+ return $models;
+ }
+
+ /**
+ * Filter an array of models, only taking models whose $constraintKey value matches $pivotValue.
+ *
+ * @param mixed $pivotValue
+ * @return array
+ */
+ protected function findMatchingPivots($items, $pivotValue)
+ {
+ $result = [];
+ foreach ($items as $item) {
+ if ($item->getRelation('pivot')->{$this->constraintKey} == $pivotValue) {
+ $result[] = $item;
+ }
+ }
+ return $result;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Database/Relations/BelongsToManyThrough.php b/login/app/sprinkles/core/src/Database/Relations/BelongsToManyThrough.php
new file mode 100755
index 0000000..33be507
--- /dev/null
+++ b/login/app/sprinkles/core/src/Database/Relations/BelongsToManyThrough.php
@@ -0,0 +1,232 @@
+intermediateRelation = $intermediateRelation;
+
+ parent::__construct($query, $parent, $table, $foreignKey, $relatedKey, $relationName);
+ }
+
+ /**
+ * Use the intermediate relationship to determine the "parent" pivot key name
+ *
+ * This is a crazy roundabout way to get the name of the intermediate relation's foreign key.
+ * It would be better if BelongsToMany had a simple accessor for its foreign key.
+ * @return string
+ */
+ public function getParentKeyName()
+ {
+ return $this->intermediateRelation->newExistingPivot()->getForeignKey();
+ }
+
+ /**
+ * Get the key for comparing against the parent key in "has" query.
+ *
+ * @see \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ * @return string
+ */
+ public function getExistenceCompareKey()
+ {
+ return $this->intermediateRelation->getQualifiedForeignKeyName();
+ }
+
+ /**
+ * Add a "via" query to load the intermediate models through which the child models are related.
+ *
+ * @param string $viaRelationName
+ * @param callable $viaCallback
+ * @return $this
+ */
+ public function withVia($viaRelationName = null, $viaCallback = null)
+ {
+ $this->tertiaryRelated = $this->intermediateRelation->getRelated();
+
+ // Set tertiary key and related model
+ $this->tertiaryKey = $this->foreignKey;
+
+ $this->tertiaryRelationName = is_null($viaRelationName) ? $this->intermediateRelation->getRelationName() . '_via' : $viaRelationName;
+
+ $this->tertiaryCallback = is_null($viaCallback)
+ ? function () {
+ //
+ }
+ : $viaCallback;
+
+ return $this;
+ }
+
+ /**
+ * Set the constraints for an eager load of the relation.
+ *
+ * @param array $models
+ * @return void
+ */
+ public function addEagerConstraints(array $models)
+ {
+ // Constraint to only load models where the intermediate relation's foreign key matches the parent model
+ $intermediateForeignKeyName = $this->intermediateRelation->getQualifiedForeignKeyName();
+
+ return $this->query->whereIn($intermediateForeignKeyName, $this->getKeys($models));
+ }
+
+ /**
+ * Set the where clause for the relation query.
+ *
+ * @return $this
+ */
+ protected function addWhereConstraints()
+ {
+ $parentKeyName = $this->getParentKeyName();
+
+ $this->query->where(
+ $parentKeyName, '=', $this->parent->getKey()
+ );
+
+ return $this;
+ }
+
+ /**
+ * Match the eagerly loaded results to their parents
+ *
+ * @param array $models
+ * @param \Illuminate\Database\Eloquent\Collection $results
+ * @param string $relation
+ * @return array
+ */
+ public function match(array $models, Collection $results, $relation)
+ {
+ // Build dictionary of parent (e.g. user) to related (e.g. permission) models
+ list($dictionary, $nestedViaDictionary) = $this->buildDictionary($results, $this->getParentKeyName());
+
+ // Once we have an array dictionary of child objects we can easily match the
+ // children back to their parent using the dictionary and the keys on the
+ // the parent models. Then we will return the hydrated models back out.
+ foreach ($models as $model) {
+ if (isset($dictionary[$key = $model->getKey()])) {
+ /** @var array */
+ $items = $dictionary[$key];
+
+ // Eliminate any duplicates
+ $items = $this->related->newCollection($items)->unique();
+
+ // If set, match up the via models to the models in the related collection
+ if (!is_null($nestedViaDictionary)) {
+ $this->matchTertiaryModels($nestedViaDictionary[$key], $items);
+ }
+
+ // Remove the tertiary pivot key from the condensed models
+ foreach ($items as $relatedModel) {
+ unset($relatedModel->pivot->{$this->foreignKey});
+ }
+
+ $model->setRelation(
+ $relation, $items
+ );
+ }
+ }
+
+ return $models;
+ }
+
+ /**
+ * Unset tertiary pivots on a collection or array of models.
+ *
+ * @param \Illuminate\Database\Eloquent\Collection $models
+ * @return void
+ */
+ protected function unsetTertiaryPivots(Collection $models)
+ {
+ foreach ($models as $model) {
+ unset($model->pivot->{$this->foreignKey});
+ }
+ }
+
+ /**
+ * Set the join clause for the relation query.
+ *
+ * @param \Illuminate\Database\Eloquent\Builder|null $query
+ * @return $this
+ */
+ protected function performJoin($query = null)
+ {
+ $query = $query ?: $this->query;
+
+ parent::performJoin($query);
+
+ // We need to join to the intermediate table on the related model's primary
+ // key column with the intermediate table's foreign key for the related
+ // model instance. Then we can set the "where" for the parent models.
+ $intermediateTable = $this->intermediateRelation->getTable();
+
+ $key = $this->intermediateRelation->getQualifiedRelatedKeyName();
+
+ $query->join($intermediateTable, $key, '=', $this->getQualifiedForeignKeyName());
+
+ return $this;
+ }
+
+ /**
+ * Get the pivot columns for the relation.
+ *
+ * "pivot_" is prefixed to each column for easy removal later.
+ *
+ * @return array
+ */
+ protected function aliasedPivotColumns()
+ {
+ $defaults = [$this->foreignKey, $this->relatedKey];
+ $aliasedPivotColumns = collect(array_merge($defaults, $this->pivotColumns))->map(function ($column) {
+ return $this->table.'.'.$column.' as pivot_'.$column;
+ });
+
+ $parentKeyName = $this->getParentKeyName();
+
+ // Add pivot column for the intermediate relation
+ $aliasedPivotColumns[] = "{$this->intermediateRelation->getQualifiedForeignKeyName()} as pivot_$parentKeyName";
+
+ return $aliasedPivotColumns->unique()->all();
+ }
+}
diff --git a/login/app/sprinkles/core/src/Database/Relations/BelongsToManyUnique.php b/login/app/sprinkles/core/src/Database/Relations/BelongsToManyUnique.php
new file mode 100755
index 0000000..f256f17
--- /dev/null
+++ b/login/app/sprinkles/core/src/Database/Relations/BelongsToManyUnique.php
@@ -0,0 +1,22 @@
+ [], 'deleted' => [], 'updated' => [],
+ ];
+
+ if (is_null($relatedKeyName)) {
+ $relatedKeyName = $this->related->getKeyName();
+ }
+
+ // First we need to attach any of the associated models that are not currently
+ // in the child entity table. We'll spin through the given IDs, checking to see
+ // if they exist in the array of current ones, and if not we will insert.
+ $current = $this->newQuery()->pluck(
+ $relatedKeyName
+ )->all();
+
+ // Separate the submitted data into "update" and "new"
+ $updateRows = [];
+ $newRows = [];
+ foreach ($data as $row) {
+ // We determine "updateable" rows as those whose $relatedKeyName (usually 'id') is set, not empty, and
+ // match a related row in the database.
+ if (isset($row[$relatedKeyName]) && !empty($row[$relatedKeyName]) && in_array($row[$relatedKeyName], $current)) {
+ $id = $row[$relatedKeyName];
+ $updateRows[$id] = $row;
+ } else {
+ $newRows[] = $row;
+ }
+ }
+
+ // Next, we'll determine the rows in the database that aren't in the "update" list.
+ // These rows will be scheduled for deletion. Again, we determine based on the relatedKeyName (typically 'id').
+ $updateIds = array_keys($updateRows);
+ $deleteIds = [];
+ foreach ($current as $currentId) {
+ if (!in_array($currentId, $updateIds)) {
+ $deleteIds[] = $currentId;
+ }
+ }
+
+ // Delete any non-matching rows
+ if ($deleting && count($deleteIds) > 0) {
+ // Remove global scopes to avoid ambiguous keys
+ $this->getRelated()
+ ->withoutGlobalScopes()
+ ->whereIn($relatedKeyName, $deleteIds)
+ ->delete();
+
+ $changes['deleted'] = $this->castKeys($deleteIds);
+ }
+
+ // Update the updatable rows
+ foreach ($updateRows as $id => $row) {
+ // Remove global scopes to avoid ambiguous keys
+ $this->getRelated()
+ ->withoutGlobalScopes()
+ ->where($relatedKeyName, $id)
+ ->update($row);
+ }
+
+ $changes['updated'] = $this->castKeys($updateIds);
+
+ // Insert the new rows
+ $newIds = [];
+ foreach ($newRows as $row) {
+ if ($forceCreate) {
+ $newModel = $this->forceCreate($row);
+ } else {
+ $newModel = $this->create($row);
+ }
+ $newIds[] = $newModel->$relatedKeyName;
+ }
+
+ $changes['created'] = $this->castKeys($newIds);
+
+ return $changes;
+ }
+
+
+ /**
+ * Cast the given keys to integers if they are numeric and string otherwise.
+ *
+ * @param array $keys
+ * @return array
+ */
+ protected function castKeys(array $keys)
+ {
+ return (array) array_map(function ($v) {
+ return $this->castKey($v);
+ }, $keys);
+ }
+
+ /**
+ * Cast the given key to an integer if it is numeric.
+ *
+ * @param mixed $key
+ * @return mixed
+ */
+ protected function castKey($key)
+ {
+ return is_numeric($key) ? (int) $key : (string) $key;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Database/Relations/Concerns/Unique.php b/login/app/sprinkles/core/src/Database/Relations/Concerns/Unique.php
new file mode 100755
index 0000000..4b529bb
--- /dev/null
+++ b/login/app/sprinkles/core/src/Database/Relations/Concerns/Unique.php
@@ -0,0 +1,563 @@
+offset($value);
+ }
+
+ /**
+ * Set the "offset" value of the query.
+ *
+ * @todo Implement for 'unionOffset' as well? (By checking the value of $this->query->getQuery()->unions)
+ * @see \Illuminate\Database\Query\Builder
+ * @param int $value
+ * @return $this
+ */
+ public function offset($value)
+ {
+ $this->offset = max(0, $value);
+
+ return $this;
+ }
+
+ /**
+ * Alias to set the "limit" value of the query.
+ *
+ * @param int $value
+ * @return $this
+ */
+ public function take($value)
+ {
+ return $this->limit($value);
+ }
+
+ /**
+ * Set the "limit" value of the query.
+ *
+ * @todo Implement for 'unionLimit' as well? (By checking the value of $this->query->getQuery()->unions)
+ * @see \Illuminate\Database\Query\Builder
+ * @param int $value
+ * @return $this
+ */
+ public function limit($value)
+ {
+ if ($value >= 0) {
+ $this->limit = $value;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set the limit on the number of intermediate models to load.
+ *
+ * @deprecated since 4.1.7
+ * @param int $value
+ * @return $this
+ */
+ public function withLimit($value)
+ {
+ return $this->limit($value);
+ }
+
+ /**
+ * Set the offset when loading the intermediate models.
+ *
+ * @deprecated since 4.1.7
+ * @param int $value
+ * @return $this
+ */
+ public function withOffset($value)
+ {
+ return $this->offset($value);
+ }
+
+ /**
+ * Add a query to load the nested tertiary models for this relationship.
+ *
+ * @param \Illuminate\Database\Eloquent\Model $tertiaryRelated
+ * @param string $tertiaryRelationName
+ * @param string $tertiaryKey
+ * @param callable $tertiaryCallback
+ * @return $this
+ */
+ public function withTertiary($tertiaryRelated, $tertiaryRelationName = null, $tertiaryKey = null, $tertiaryCallback = null)
+ {
+ $this->tertiaryRelated = new $tertiaryRelated;
+
+ // Try to guess the tertiary related key from the tertiaryRelated model.
+ $this->tertiaryKey = $tertiaryKey ?: $this->tertiaryRelated->getForeignKey();
+
+ // Also add the tertiary key as a pivot
+ $this->withPivot($this->tertiaryKey);
+
+ $this->tertiaryRelationName = is_null($tertiaryRelationName) ? $this->tertiaryRelated->getTable() : $tertiaryRelationName;
+
+ $this->tertiaryCallback = is_null($tertiaryCallback)
+ ? function () {
+ //
+ }
+ : $tertiaryCallback;
+
+ return $this;
+ }
+
+ /**
+ * Return the count of child models for this relationship.
+ *
+ * @see http://stackoverflow.com/a/29728129/2970321
+ * @return int
+ */
+ public function count()
+ {
+ $constrainedBuilder = clone $this->query;
+
+ $constrainedBuilder = $constrainedBuilder->distinct();
+
+ return $constrainedBuilder->count($this->relatedKey);
+ }
+
+ /**
+ * Add the constraints for a relationship count query.
+ *
+ * @see \Illuminate\Database\Eloquent\Relations\Relation
+ * @param \Illuminate\Database\Eloquent\Builder $query
+ * @param \Illuminate\Database\Eloquent\Builder $parentQuery
+ * @return \Illuminate\Database\Eloquent\Builder
+ */
+ public function getRelationExistenceCountQuery(Builder $query, Builder $parentQuery)
+ {
+ return $this->getRelationExistenceQuery(
+ $query, $parentQuery, new Expression("count(distinct {$this->relatedKey})")
+ );
+ }
+
+ /**
+ * Match the eagerly loaded results to their parents
+ *
+ * @param array $models
+ * @param \Illuminate\Database\Eloquent\Collection $results
+ * @param string $relation
+ * @return array
+ */
+ public function match(array $models, Collection $results, $relation)
+ {
+ // Build dictionary of parent (e.g. user) to related (e.g. permission) models
+ list($dictionary, $nestedTertiaryDictionary) = $this->buildDictionary($results, $this->foreignKey);
+
+ // Once we have an array dictionary of child objects we can easily match the
+ // children back to their parent using the dictionary and the keys on the
+ // the parent models. Then we will return the hydrated models back out.
+ foreach ($models as $model) {
+ if (isset($dictionary[$key = $model->getKey()])) {
+ /** @var array */
+ $items = $dictionary[$key];
+
+ // Eliminate any duplicates
+ $items = $this->related->newCollection($items)->unique();
+
+ // If set, match up the tertiary models to the models in the related collection
+ if (!is_null($nestedTertiaryDictionary)) {
+ $this->matchTertiaryModels($nestedTertiaryDictionary[$key], $items);
+ }
+
+ $model->setRelation(
+ $relation, $items
+ );
+ }
+ }
+
+ return $models;
+ }
+
+ /**
+ * Execute the query as a "select" statement, getting all requested models
+ * and matching up any tertiary models.
+ *
+ * @param array $columns
+ * @return \Illuminate\Database\Eloquent\Collection
+ */
+ public function get($columns = ['*'])
+ {
+ // Get models and condense the result set
+ $models = $this->getModels($columns, true);
+
+ // Remove the tertiary pivot key from the condensed models
+ $this->unsetTertiaryPivots($models);
+
+ return $models;
+ }
+
+ /**
+ * If we are applying either a limit or offset, we'll first determine a limited/offset list of model ids
+ * to select from in the final query.
+ *
+ * @param \Illuminate\Database\Eloquent\Builder $query
+ * @param int $limit
+ * @param int $offset
+ * @return \Illuminate\Database\Eloquent\Builder
+ */
+ public function getPaginatedQuery(Builder $query, $limit = null, $offset = null)
+ {
+ $constrainedBuilder = clone $query;
+
+ // Since some unique models will be represented by more than one row in the database,
+ // we cannot apply limit/offset directly to the query. If we did that, we'd miss
+ // some of the records that are to be coalesced into the final set of models.
+ // Instead, we perform an additional query with grouping and limit/offset to determine
+ // the desired set of unique model _ids_, and then constrain our final query
+ // to these models with a whereIn clause.
+ $relatedKeyName = $this->related->getQualifiedKeyName();
+
+ // Apply an additional scope to override any selected columns in other global scopes
+ $uniqueIdScope = function ($subQuery) use ($relatedKeyName) {
+ $subQuery->select($relatedKeyName)
+ ->groupBy($relatedKeyName);
+ };
+
+ $identifier = spl_object_hash($uniqueIdScope);
+
+ $constrainedBuilder->withGlobalScope($identifier, $uniqueIdScope);
+
+ if ($limit) {
+ $constrainedBuilder->limit($limit);
+ }
+
+ if ($offset) {
+ $constrainedBuilder->offset($offset);
+ }
+
+ $primaryKeyName = $this->getParent()->getKeyName();
+ $modelIds = $constrainedBuilder->get()->pluck($primaryKeyName)->toArray();
+
+ // Modify the unconstrained query to limit to these models
+ return $query->whereIn($relatedKeyName, $modelIds);
+ }
+
+ /**
+ * Get the full join results for this query, overriding the default getEager() method.
+ * The default getEager() method would normally just call get() on this relationship.
+ * This is not what we want here though, because our get() method removes records before
+ * `match` has a chance to build out the substructures.
+ *
+ * @return \Illuminate\Database\Eloquent\Collection
+ */
+ public function getEager()
+ {
+ return $this->getModels(['*'], false);
+ }
+
+ /**
+ * Get the hydrated models and eager load their relations, optionally
+ * condensing the set of models before performing the eager loads.
+ *
+ * @param array $columns
+ * @param bool $condenseModels
+ * @return \Illuminate\Database\Eloquent\Collection
+ */
+ public function getModels($columns = ['*'], $condenseModels = true)
+ {
+ // First we'll add the proper select columns onto the query so it is run with
+ // the proper columns. Then, we will get the results and hydrate out pivot
+ // models with the result of those columns as a separate model relation.
+ $columns = $this->query->getQuery()->columns ? [] : $columns;
+
+ // Add any necessary pagination on the related models
+ if ($this->limit || $this->offset) {
+ $this->getPaginatedQuery($this->query, $this->limit, $this->offset);
+ }
+
+ // Apply scopes to the Eloquent\Builder instance.
+ $builder = $this->query->applyScopes();
+
+ $builder = $builder->addSelect(
+ $this->shouldSelect($columns)
+ );
+
+ $models = $builder->getModels();
+
+ // Hydrate the pivot models so we can load the via models
+ $this->hydratePivotRelation($models);
+
+ if ($condenseModels) {
+ $models = $this->condenseModels($models);
+ }
+
+ // If we actually found models we will also eager load any relationships that
+ // have been specified as needing to be eager loaded. This will solve the
+ // n + 1 query problem for the developer and also increase performance.
+ if (count($models) > 0) {
+ $models = $builder->eagerLoadRelations($models);
+ }
+
+ return $this->related->newCollection($models);
+ }
+
+ /**
+ * Condense the raw join query results into a set of unique models.
+ *
+ * Before doing this, we may optionally find any tertiary models that should be
+ * set as sub-relations on these models.
+ * @param array $models
+ * @return array
+ */
+ protected function condenseModels(array $models)
+ {
+ // Build dictionary of tertiary models, if `withTertiary` was called
+ $dictionary = null;
+ if ($this->tertiaryRelated) {
+ $dictionary = $this->buildTertiaryDictionary($models);
+ }
+
+ // Remove duplicate models from collection
+ $models = $this->related->newCollection($models)->unique();
+
+ // If using withTertiary, use the dictionary to set the tertiary relation on each model.
+ if (!is_null($dictionary)) {
+ $this->matchTertiaryModels($dictionary, $models);
+ }
+
+ return $models->all();
+ }
+
+ /**
+ * Build dictionary of related models keyed by the top-level "parent" id.
+ * If there is a tertiary query set as well, then also build a two-level dictionary
+ * that maps parent ids to arrays of related ids, which in turn map to arrays
+ * of tertiary models corresponding to each relationship.
+ *
+ * @param \Illuminate\Database\Eloquent\Collection $results
+ * @param string $parentKey
+ * @return array
+ */
+ protected function buildDictionary(Collection $results, $parentKey = null)
+ {
+ // First we will build a dictionary of child models keyed by the "parent key" (foreign key
+ // of the intermediate relation) so that we will easily and quickly match them to their
+ // parents without having a possibly slow inner loops for every models.
+ $dictionary = [];
+
+ //Example nested dictionary:
+ //[
+ // // User 1
+ // '1' => [
+ // // Permission 3
+ // '3' => [
+ // Role1,
+ // Role2
+ // ],
+ // ...
+ // ],
+ // ...
+ //]
+ $nestedTertiaryDictionary = null;
+ $tertiaryModels = null;
+
+ if ($this->tertiaryRelationName) {
+ // Get all tertiary models from the result set matching any of the parent models.
+ $tertiaryModels = $this->getTertiaryModels($results->all());
+ }
+
+ foreach ($results as $result) {
+ $parentKeyValue = $result->pivot->$parentKey;
+
+ // Set the related model in the main dictionary.
+ // Note that this can end up adding duplicate models. It's cheaper to simply
+ // go back and remove the duplicates when we actually use the dictionary,
+ // rather than check for duplicates on each insert.
+ $dictionary[$parentKeyValue][] = $result;
+
+ // If we're loading tertiary models, then set the keys in the nested dictionary as well.
+ if (!is_null($tertiaryModels)) {
+ $tertiaryKeyValue = $result->pivot->{$this->tertiaryKey};
+
+ if (!is_null($tertiaryKeyValue)) {
+ $tertiaryModel = clone $tertiaryModels[$tertiaryKeyValue];
+
+ // We also transfer the pivot relation at this point, since we have already coalesced
+ // any tertiary models into the nested dictionary.
+ $this->transferPivotsToTertiary($result, $tertiaryModel);
+
+ $nestedTertiaryDictionary[$parentKeyValue][$result->getKey()][] = $tertiaryModel;
+ }
+ }
+ }
+
+ return [$dictionary, $nestedTertiaryDictionary];
+ }
+
+ /**
+ * Build dictionary of tertiary models keyed by the corresponding related model keys.
+ *
+ * @param array $models
+ * @return array
+ */
+ protected function buildTertiaryDictionary(array $models)
+ {
+ $dictionary = [];
+
+ // Find the related tertiary entities (e.g. tasks) for all related models (e.g. locations)
+ $tertiaryModels = $this->getTertiaryModels($models);
+
+ // Now for each related model (e.g. location), we will build out a dictionary of their tertiary models (e.g. tasks)
+ foreach ($models as $model) {
+ $tertiaryKeyValue = $model->pivot->{$this->tertiaryKey};
+
+ $tertiaryModel = clone $tertiaryModels[$tertiaryKeyValue];
+
+ $this->transferPivotsToTertiary($model, $tertiaryModel);
+
+ $dictionary[$model->getKey()][] = $tertiaryModel;
+ }
+
+ return $dictionary;
+ }
+
+ protected function transferPivotsToTertiary($model, $tertiaryModel)
+ {
+ $pivotAttributes = [];
+ foreach ($this->pivotColumns as $column) {
+ $pivotAttributes[$column] = $model->pivot->$column;
+ unset($model->pivot->$column);
+ }
+ // Copy the related key pivot as well, but don't unset on the related model
+ $pivotAttributes[$this->relatedKey] = $model->pivot->{$this->relatedKey};
+
+ // Set the tertiary key pivot as well
+ $pivotAttributes[$this->tertiaryKey] = $tertiaryModel->getKey();
+
+ $pivot = $this->newExistingPivot($pivotAttributes);
+ $tertiaryModel->setRelation('pivot', $pivot);
+ }
+
+ /**
+ * Get the tertiary models for the relationship.
+ *
+ * @param array $models
+ * @return \Illuminate\Database\Eloquent\Collection
+ */
+ protected function getTertiaryModels(array $models)
+ {
+ $tertiaryClass = $this->tertiaryRelated;
+
+ $keys = [];
+ foreach ($models as $model) {
+ $keys[] = $model->getRelation('pivot')->{$this->tertiaryKey};
+ }
+ $keys = array_unique($keys);
+
+ $query = $tertiaryClass->whereIn($tertiaryClass->getQualifiedKeyName(), $keys);
+
+ // Add any additional constraints/eager loads to the tertiary query
+ $callback = $this->tertiaryCallback;
+ $callback($query);
+
+ $tertiaryModels = $query
+ ->get()
+ ->keyBy($tertiaryClass->getKeyName());
+
+ return $tertiaryModels;
+ }
+
+ /**
+ * Match a collection of child models into a collection of parent models using a dictionary.
+ *
+ * @param array $dictionary
+ * @param \Illuminate\Database\Eloquent\Collection $results
+ * @return void
+ */
+ protected function matchTertiaryModels(array $dictionary, Collection $results)
+ {
+ // Now go through and set the tertiary relation on each child model
+ foreach ($results as $model) {
+ if (isset($dictionary[$key = $model->getKey()])) {
+ $tertiaryModels = $dictionary[$key];
+
+ $model->setRelation(
+ $this->tertiaryRelationName, $this->tertiaryRelated->newCollection($tertiaryModels)
+ );
+ }
+ }
+ }
+
+ /**
+ * Unset tertiary pivots on a collection or array of models.
+ *
+ * @param \Illuminate\Database\Eloquent\Collection $models
+ * @return void
+ */
+ protected function unsetTertiaryPivots(Collection $models)
+ {
+ foreach ($models as $model) {
+ foreach ($this->pivotColumns as $column) {
+ unset($model->pivot->$column);
+ }
+ }
+ }
+}
diff --git a/login/app/sprinkles/core/src/Database/Relations/HasManySyncable.php b/login/app/sprinkles/core/src/Database/Relations/HasManySyncable.php
new file mode 100755
index 0000000..bcf2a9d
--- /dev/null
+++ b/login/app/sprinkles/core/src/Database/Relations/HasManySyncable.php
@@ -0,0 +1,22 @@
+ci = $ci;
+ $this->displayErrorDetails = (bool)$displayErrorDetails;
+ }
+
+ /**
+ * Invoke error handler
+ *
+ * @param ServerRequestInterface $request The most recent Request object
+ * @param ResponseInterface $response The most recent Response object
+ * @param Throwable $exception The caught Exception object
+ *
+ * @return ResponseInterface
+ */
+ public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $exception)
+ {
+ // Default exception handler class
+ $handlerClass = '\UserFrosting\Sprinkle\Core\Error\Handler\ExceptionHandler';
+
+ // Get the last matching registered handler class, and instantiate it
+ foreach ($this->exceptionHandlers as $exceptionClass => $matchedHandlerClass) {
+ if ($exception instanceof $exceptionClass) {
+ $handlerClass = $matchedHandlerClass;
+ }
+ }
+
+ $handler = new $handlerClass($this->ci, $request, $response, $exception, $this->displayErrorDetails);
+
+ return $handler->handle();
+ }
+
+ /**
+ * Register an exception handler for a specified exception class.
+ *
+ * The exception handler must implement \UserFrosting\Sprinkle\Core\Handler\ExceptionHandlerInterface.
+ *
+ * @param string $exceptionClass The fully qualified class name of the exception to handle.
+ * @param string $handlerClass The fully qualified class name of the assigned handler.
+ * @throws InvalidArgumentException If the registered handler fails to implement ExceptionHandlerInterface
+ */
+ public function registerHandler($exceptionClass, $handlerClass)
+ {
+ if (!is_a($handlerClass, '\UserFrosting\Sprinkle\Core\Error\Handler\ExceptionHandlerInterface', true)) {
+ throw new \InvalidArgumentException("Registered exception handler must implement ExceptionHandlerInterface!");
+ }
+
+ $this->exceptionHandlers[$exceptionClass] = $handlerClass;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Error/Handler/ExceptionHandler.php b/login/app/sprinkles/core/src/Error/Handler/ExceptionHandler.php
new file mode 100755
index 0000000..4fdc51d
--- /dev/null
+++ b/login/app/sprinkles/core/src/Error/Handler/ExceptionHandler.php
@@ -0,0 +1,275 @@
+ci = $ci;
+ $this->request = $request;
+ $this->response = $response;
+ $this->exception = $exception;
+ $this->displayErrorDetails = $displayErrorDetails;
+ $this->statusCode = $this->determineStatusCode();
+ $this->contentType = $this->determineContentType($request, $this->ci->config['site.debug.ajax']);
+ $this->renderer = $this->determineRenderer();
+ }
+
+ /**
+ * Handle the caught exception.
+ * The handler may render a detailed debugging error page, a generic error page, write to logs, and/or add messages to the alert stream.
+ *
+ * @return ResponseInterface
+ */
+ public function handle()
+ {
+ // If displayErrorDetails is set to true, we'll halt and immediately respond with a detailed debugging page.
+ // We do not log errors in this case.
+ if ($this->displayErrorDetails) {
+ $response = $this->renderDebugResponse();
+ } else {
+ // Write exception to log
+ $this->writeToErrorLog();
+
+ // Render generic error page
+ $response = $this->renderGenericResponse();
+ }
+
+ // If this is an AJAX request and AJAX debugging is turned off, write messages to the alert stream
+ if ($this->request->isXhr() && !$this->ci->config['site.debug.ajax']) {
+ $this->writeAlerts();
+ }
+
+ return $response;
+ }
+
+ /**
+ * Render a detailed response with debugging information.
+ *
+ * @return ResponseInterface
+ */
+ public function renderDebugResponse()
+ {
+ $body = $this->renderer->renderWithBody();
+
+ return $this->response
+ ->withStatus($this->statusCode)
+ ->withHeader('Content-type', $this->contentType)
+ ->withBody($body);
+ }
+
+ /**
+ * Render a generic, user-friendly response without sensitive debugging information.
+ *
+ * @return ResponseInterface
+ */
+ public function renderGenericResponse()
+ {
+ $messages = $this->determineUserMessages();
+ $httpCode = $this->statusCode;
+
+ try {
+ $template = $this->ci->view->getEnvironment()->loadTemplate("pages/error/$httpCode.html.twig");
+ } catch (\Twig_Error_Loader $e) {
+ $template = $this->ci->view->getEnvironment()->loadTemplate("pages/abstract/error.html.twig");
+ }
+
+ return $this->response
+ ->withStatus($httpCode)
+ ->withHeader('Content-type', $this->contentType)
+ ->write($template->render([
+ 'messages' => $messages
+ ]));
+ }
+
+ /**
+ * Write to the error log
+ *
+ * @return void
+ */
+ public function writeToErrorLog()
+ {
+ $renderer = new PlainTextRenderer($this->request, $this->response, $this->exception, true);
+ $error = $renderer->render();
+ $error .= PHP_EOL . 'View in rendered output by enabling the "displayErrorDetails" setting.' . PHP_EOL;
+ $this->logError($error);
+ }
+
+ /**
+ * Write user-friendly error messages to the alert message stream.
+ *
+ * @return void
+ */
+ public function writeAlerts()
+ {
+ $messages = $this->determineUserMessages();
+
+ foreach ($messages as $message) {
+ $this->ci->alerts->addMessageTranslated('danger', $message->message, $message->parameters);
+ }
+ }
+
+ /**
+ * Determine which renderer to use based on content type
+ * Overloaded $renderer from calling class takes precedence over all
+ *
+ * @return ErrorRendererInterface
+ *
+ * @throws \RuntimeException
+ */
+ protected function determineRenderer()
+ {
+ $renderer = $this->renderer;
+
+ if ((!is_null($renderer) && !class_exists($renderer))
+ || (!is_null($renderer) && !in_array('UserFrosting\Sprinkle\Core\Error\Renderer\ErrorRendererInterface', class_implements($renderer)))
+ ) {
+ throw new \RuntimeException(sprintf(
+ 'Non compliant error renderer provided (%s). ' .
+ 'Renderer must implement the ErrorRendererInterface',
+ $renderer
+ ));
+ }
+
+ if (is_null($renderer)) {
+ switch ($this->contentType) {
+ case 'application/json':
+ $renderer = JsonRenderer::class;
+ break;
+
+ case 'text/xml':
+ case 'application/xml':
+ $renderer = XmlRenderer::class;
+ break;
+
+ case 'text/plain':
+ $renderer = PlainTextRenderer::class;
+ break;
+
+ default:
+ case 'text/html':
+ $renderer = WhoopsRenderer::class;
+ break;
+ }
+ }
+
+ return new $renderer($this->request, $this->response, $this->exception, $this->displayErrorDetails);
+ }
+
+ /**
+ * Resolve the status code to return in the response from this handler.
+ *
+ * @return int
+ */
+ protected function determineStatusCode()
+ {
+ if ($this->request->getMethod() === 'OPTIONS') {
+ return 200;
+ }
+ return 500;
+ }
+
+ /**
+ * Resolve a list of error messages to present to the end user.
+ *
+ * @return array
+ */
+ protected function determineUserMessages()
+ {
+ return [
+ new UserMessage("ERROR.SERVER")
+ ];
+ }
+
+ /**
+ * Monolog logging for errors
+ *
+ * @param $message
+ * @return void
+ */
+ protected function logError($message)
+ {
+ $this->ci->errorLogger->error($message);
+ }
+}
diff --git a/login/app/sprinkles/core/src/Error/Handler/ExceptionHandlerInterface.php b/login/app/sprinkles/core/src/Error/Handler/ExceptionHandlerInterface.php
new file mode 100755
index 0000000..a928b69
--- /dev/null
+++ b/login/app/sprinkles/core/src/Error/Handler/ExceptionHandlerInterface.php
@@ -0,0 +1,32 @@
+statusCode != 500) {
+ return;
+ }
+
+ parent::writeToErrorLog();
+ }
+
+ /**
+ * Resolve the status code to return in the response from this handler.
+ *
+ * @return int
+ */
+ protected function determineStatusCode()
+ {
+ if ($this->request->getMethod() === 'OPTIONS') {
+ return 200;
+ } elseif ($this->exception instanceof HttpException) {
+ return $this->exception->getHttpErrorCode();
+ }
+ return 500;
+ }
+
+ /**
+ * Resolve a list of error messages to present to the end user.
+ *
+ * @return array
+ */
+ protected function determineUserMessages()
+ {
+ if ($this->exception instanceof HttpException) {
+ return $this->exception->getUserMessages();
+ }
+
+ // Fallback
+ return [
+ new UserMessage("ERROR.SERVER")
+ ];
+ }
+}
diff --git a/login/app/sprinkles/core/src/Error/Handler/NotFoundExceptionHandler.php b/login/app/sprinkles/core/src/Error/Handler/NotFoundExceptionHandler.php
new file mode 100755
index 0000000..306feed
--- /dev/null
+++ b/login/app/sprinkles/core/src/Error/Handler/NotFoundExceptionHandler.php
@@ -0,0 +1,38 @@
+renderGenericResponse();
+
+ // If this is an AJAX request and AJAX debugging is turned off, write messages to the alert stream
+ if ($this->request->isXhr() && !$this->ci->config['site.debug.ajax']) {
+ $this->writeAlerts();
+ }
+
+ return $response;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Error/Handler/PhpMailerExceptionHandler.php b/login/app/sprinkles/core/src/Error/Handler/PhpMailerExceptionHandler.php
new file mode 100755
index 0000000..45f0e8d
--- /dev/null
+++ b/login/app/sprinkles/core/src/Error/Handler/PhpMailerExceptionHandler.php
@@ -0,0 +1,30 @@
+request = $request;
+ $this->response = $response;
+ $this->exception = $exception;
+ $this->displayErrorDetails = $displayErrorDetails;
+ }
+
+ abstract public function render();
+
+ /**
+ * @return Body
+ */
+ public function renderWithBody()
+ {
+ $body = new Body(fopen('php://temp', 'r+'));
+ $body->write($this->render());
+ return $body;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Error/Renderer/ErrorRendererInterface.php b/login/app/sprinkles/core/src/Error/Renderer/ErrorRendererInterface.php
new file mode 100755
index 0000000..7af269a
--- /dev/null
+++ b/login/app/sprinkles/core/src/Error/Renderer/ErrorRendererInterface.php
@@ -0,0 +1,29 @@
+displayErrorDetails) {
+ $html = 'The application could not run because of the following error:
';
+ $html .= 'Details ';
+ $html .= $this->renderException($this->exception);
+
+ $html .= 'Your request ';
+ $html .= $this->renderRequest();
+
+ $html .= 'Response headers ';
+ $html .= $this->renderResponseHeaders();
+
+ $exception = $this->exception;
+ while ($exception = $exception->getPrevious()) {
+ $html .= 'Previous exception ';
+ $html .= $this->renderException($exception);
+ }
+ } else {
+ $html = 'A website error has occurred. Sorry for the temporary inconvenience.
';
+ }
+
+ $output = sprintf(
+ " " .
+ "%s %s %s",
+ $title,
+ $title,
+ $html
+ );
+
+ return $output;
+ }
+
+ /**
+ * Render a summary of the exception.
+ *
+ * @param Exception $exception
+ * @return string
+ */
+ public function renderException($exception)
+ {
+ $html = sprintf('Type: %s
', get_class($exception));
+
+ if (($code = $exception->getCode())) {
+ $html .= sprintf('Code: %s
', $code);
+ }
+
+ if (($message = $exception->getMessage())) {
+ $html .= sprintf('Message: %s
', htmlentities($message));
+ }
+
+ if (($file = $exception->getFile())) {
+ $html .= sprintf('File: %s
', $file);
+ }
+
+ if (($line = $exception->getLine())) {
+ $html .= sprintf('Line: %s
', $line);
+ }
+
+ if (($trace = $exception->getTraceAsString())) {
+ $html .= 'Trace ';
+ $html .= sprintf('%s ', htmlentities($trace));
+ }
+
+ return $html;
+ }
+
+ /**
+ * Render HTML representation of original request.
+ *
+ * @return string
+ */
+ public function renderRequest()
+ {
+ $method = $this->request->getMethod();
+ $uri = $this->request->getUri();
+ $params = $this->request->getParams();
+ $requestHeaders = $this->request->getHeaders();
+
+ $html = 'Request URI: ';
+
+ $html .= sprintf('%s %s
', $method, $uri);
+
+ $html .= 'Request parameters: ';
+
+ $html .= $this->renderTable($params);
+
+ $html .= 'Request headers: ';
+
+ $html .= $this->renderTable($requestHeaders);
+
+ return $html;
+ }
+
+ /**
+ * Render HTML representation of response headers.
+ *
+ * @return string
+ */
+ public function renderResponseHeaders()
+ {
+ $html = 'Response headers: ';
+ $html .= 'Additional response headers may have been set by Slim after the error handling routine. Please check your browser console for a complete list. ';
+
+ $html .= $this->renderTable($this->response->getHeaders());
+
+ return $html;
+ }
+
+ /**
+ * Render HTML representation of a table of data.
+ *
+ * @param mixed[] $data the array of data to render.
+ *
+ * @return string
+ */
+ protected function renderTable($data)
+ {
+ $html = 'Name Value ';
+ foreach ($data as $name => $value) {
+ $value = print_r($value, true);
+ $html .= "$name $value ";
+ }
+ $html .= '
';
+
+ return $html;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Error/Renderer/JsonRenderer.php b/login/app/sprinkles/core/src/Error/Renderer/JsonRenderer.php
new file mode 100755
index 0000000..3adfd45
--- /dev/null
+++ b/login/app/sprinkles/core/src/Error/Renderer/JsonRenderer.php
@@ -0,0 +1,57 @@
+exception->getMessage();
+ return $this->formatExceptionPayload($message);
+ }
+
+ /**
+ * @param $message
+ * @return string
+ */
+ public function formatExceptionPayload($message)
+ {
+ $e = $this->exception;
+ $error = ['message' => $message];
+
+ if ($this->displayErrorDetails) {
+ $error['exception'] = [];
+ do {
+ $error['exception'][] = $this->formatExceptionFragment($e);
+ } while ($e = $e->getPrevious());
+ }
+
+ return json_encode($error, JSON_PRETTY_PRINT);
+ }
+
+ /**
+ * @param \Exception|\Throwable $e
+ * @return array
+ */
+ public function formatExceptionFragment($e)
+ {
+ return [
+ 'type' => get_class($e),
+ 'code' => $e->getCode(),
+ 'message' => $e->getMessage(),
+ 'file' => $e->getFile(),
+ 'line' => $e->getLine(),
+ ];
+ }
+}
diff --git a/login/app/sprinkles/core/src/Error/Renderer/PlainTextRenderer.php b/login/app/sprinkles/core/src/Error/Renderer/PlainTextRenderer.php
new file mode 100755
index 0000000..a4984fc
--- /dev/null
+++ b/login/app/sprinkles/core/src/Error/Renderer/PlainTextRenderer.php
@@ -0,0 +1,65 @@
+displayErrorDetails) {
+ return $this->formatExceptionBody();
+ }
+
+ return $this->exception->getMessage();
+ }
+
+ public function formatExceptionBody()
+ {
+ $e = $this->exception;
+
+ $text = 'UserFrosting Application Error:' . PHP_EOL;
+ $text .= $this->formatExceptionFragment($e);
+
+ while ($e = $e->getPrevious()) {
+ $text .= PHP_EOL . 'Previous Error:' . PHP_EOL;
+ $text .= $this->formatExceptionFragment($e);
+ }
+
+ return $text;
+ }
+
+ /**
+ * @param \Exception|\Throwable $e
+ * @return string
+ */
+ public function formatExceptionFragment($e)
+ {
+ $text = sprintf('Type: %s' . PHP_EOL, get_class($e));
+
+ if ($code = $e->getCode()) {
+ $text .= sprintf('Code: %s' . PHP_EOL, $code);
+ }
+ if ($message = $e->getMessage()) {
+ $text .= sprintf('Message: %s' . PHP_EOL, htmlentities($message));
+ }
+ if ($file = $e->getFile()) {
+ $text .= sprintf('File: %s' . PHP_EOL, $file);
+ }
+ if ($line = $e->getLine()) {
+ $text .= sprintf('Line: %s' . PHP_EOL, $line);
+ }
+ if ($trace = $e->getTraceAsString()) {
+ $text .= sprintf('Trace: %s', $trace);
+ }
+
+ return $text;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Error/Renderer/WhoopsRenderer.php b/login/app/sprinkles/core/src/Error/Renderer/WhoopsRenderer.php
new file mode 100755
index 0000000..767ce1b
--- /dev/null
+++ b/login/app/sprinkles/core/src/Error/Renderer/WhoopsRenderer.php
@@ -0,0 +1,712 @@
+ [],
+ '_POST' => [],
+ '_FILES' => [],
+ '_COOKIE' => [],
+ '_SESSION' => [],
+ '_SERVER' => ['DB_PASSWORD', 'SMTP_PASSWORD'],
+ '_ENV' => ['DB_PASSWORD', 'SMTP_PASSWORD'],
+ ];
+
+ /**
+ * A string identifier for a known IDE/text editor, or a closure
+ * that resolves a string that can be used to open a given file
+ * in an editor. If the string contains the special substrings
+ * %file or %line, they will be replaced with the correct data.
+ *
+ * @example
+ * "txmt://open?url=%file&line=%line"
+ * @var mixed $editor
+ */
+ protected $editor;
+
+ /**
+ * A list of known editor strings
+ * @var array
+ */
+ protected $editors = [
+ "sublime" => "subl://open?url=file://%file&line=%line",
+ "textmate" => "txmt://open?url=file://%file&line=%line",
+ "emacs" => "emacs://open?url=file://%file&line=%line",
+ "macvim" => "mvim://open/?url=file://%file&line=%line",
+ "phpstorm" => "phpstorm://open?file=%file&line=%line",
+ "idea" => "idea://open?file=%file&line=%line",
+ ];
+
+ /**
+ * @var Inspector
+ */
+ protected $inspector;
+
+ /**
+ * @var TemplateHelper
+ */
+ private $templateHelper;
+
+ /**
+ * {@inheritDoc}
+ */
+ public function __construct($request, $response, $exception, $displayErrorDetails = false)
+ {
+ $this->request = $request;
+ $this->response = $response;
+ $this->exception = $exception;
+ $this->displayErrorDetails = $displayErrorDetails;
+
+ if (ini_get('xdebug.file_link_format') || extension_loaded('xdebug')) {
+ // Register editor using xdebug's file_link_format option.
+ $this->editors['xdebug'] = function ($file, $line) {
+ return str_replace(['%f', '%l'], [$file, $line], ini_get('xdebug.file_link_format'));
+ };
+ }
+
+ // Add the default, local resource search path:
+ $this->searchPaths[] = \UserFrosting\VENDOR_DIR . '/filp/whoops/src/Whoops/Resources';
+
+ // blacklist php provided auth based values
+ $this->blacklist('_SERVER', 'PHP_AUTH_PW');
+
+ $this->templateHelper = new TemplateHelper();
+
+ // Set up dummy inspector
+ $this->inspector = new Inspector($exception);
+
+ if (class_exists('Symfony\Component\VarDumper\Cloner\VarCloner')) {
+ $cloner = new VarCloner();
+ // Only dump object internals if a custom caster exists.
+ $cloner->addCasters(['*' => function ($obj, $a, $stub, $isNested, $filter = 0) {
+ $class = $stub->class;
+ $classes = [$class => $class] + class_parents($class) + class_implements($class);
+
+ foreach ($classes as $class) {
+ if (isset(AbstractCloner::$defaultCasters[$class])) {
+ return $a;
+ }
+ }
+
+ // Remove all internals
+ return [];
+ }]);
+ $this->templateHelper->setCloner($cloner);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function render()
+ {
+ if (!$this->handleUnconditionally()) {
+ // Check conditions for outputting HTML:
+ // @todo: Make this more robust
+ if (php_sapi_name() === 'cli') {
+ // Help users who have been relying on an internal test value
+ // fix their code to the proper method
+ if (isset($_ENV['whoops-test'])) {
+ throw new \Exception(
+ 'Use handleUnconditionally instead of whoops-test'
+ .' environment variable'
+ );
+ }
+
+ return Handler::DONE;
+ }
+ }
+
+ $templateFile = $this->getResource("views/layout.html.php");
+ $cssFile = $this->getResource("css/whoops.base.css");
+ $zeptoFile = $this->getResource("js/zepto.min.js");
+ $clipboard = $this->getResource("js/clipboard.min.js");
+ $jsFile = $this->getResource("js/whoops.base.js");
+
+ if ($this->customCss) {
+ $customCssFile = $this->getResource($this->customCss);
+ }
+
+ $inspector = $this->getInspector();
+ $frames = $inspector->getFrames();
+
+ $code = $inspector->getException()->getCode();
+
+ if ($inspector->getException() instanceof \ErrorException) {
+ // ErrorExceptions wrap the php-error types within the "severity" property
+ $code = Misc::translateErrorCode($inspector->getException()->getSeverity());
+ }
+
+ // Detect frames that belong to the application.
+ if ($this->applicationPaths) {
+ /* @var \Whoops\Exception\Frame $frame */
+ foreach ($frames as $frame) {
+ foreach ($this->applicationPaths as $path) {
+ if (substr($frame->getFile(), 0, strlen($path)) === $path) {
+ $frame->setApplication(true);
+ break;
+ }
+ }
+ }
+ }
+
+ // Nicely format the session object
+ $session = isset($_SESSION) ? $this->masked($_SESSION, '_SESSION') : [];
+ $session = ['session' => Util::prettyPrintArray($session)];
+
+ // List of variables that will be passed to the layout template.
+ $vars = [
+ "page_title" => $this->getPageTitle(),
+
+ // @todo: Asset compiler
+ "stylesheet" => file_get_contents($cssFile),
+ "zepto" => file_get_contents($zeptoFile),
+ "clipboard" => file_get_contents($clipboard),
+ "javascript" => file_get_contents($jsFile),
+
+ // Template paths:
+ "header" => $this->getResource("views/header.html.php"),
+ "header_outer" => $this->getResource("views/header_outer.html.php"),
+ "frame_list" => $this->getResource("views/frame_list.html.php"),
+ "frames_description" => $this->getResource("views/frames_description.html.php"),
+ "frames_container" => $this->getResource("views/frames_container.html.php"),
+ "panel_details" => $this->getResource("views/panel_details.html.php"),
+ "panel_details_outer" => $this->getResource("views/panel_details_outer.html.php"),
+ "panel_left" => $this->getResource("views/panel_left.html.php"),
+ "panel_left_outer" => $this->getResource("views/panel_left_outer.html.php"),
+ "frame_code" => $this->getResource("views/frame_code.html.php"),
+ "env_details" => $this->getResource("views/env_details.html.php"),
+
+ "title" => $this->getPageTitle(),
+ "name" => explode("\\", $inspector->getExceptionName()),
+ "message" => $inspector->getException()->getMessage(),
+ "code" => $code,
+ "plain_exception" => Formatter::formatExceptionPlain($inspector),
+ "frames" => $frames,
+ "has_frames" => !!count($frames),
+ "handler" => $this,
+ "handlers" => [$this],
+
+ "active_frames_tab" => count($frames) && $frames->offsetGet(0)->isApplication() ? 'application' : 'all',
+ "has_frames_tabs" => $this->getApplicationPaths(),
+
+ "tables" => [
+ "GET Data" => $this->masked($_GET, '_GET'),
+ "POST Data" => $this->masked($_POST, '_POST'),
+ "Files" => isset($_FILES) ? $this->masked($_FILES, '_FILES') : [],
+ "Cookies" => $this->masked($_COOKIE, '_COOKIE'),
+ "Session" => $session,
+ "Server/Request Data" => $this->masked($_SERVER, '_SERVER'),
+ "Environment Variables" => $this->masked($_ENV, '_ENV'),
+ ],
+ ];
+
+ if (isset($customCssFile)) {
+ $vars["stylesheet"] .= file_get_contents($customCssFile);
+ }
+
+ // Add extra entries list of data tables:
+ // @todo: Consolidate addDataTable and addDataTableCallback
+ $extraTables = array_map(function ($table) use ($inspector) {
+ return $table instanceof \Closure ? $table($inspector) : $table;
+ }, $this->getDataTables());
+ $vars["tables"] = array_merge($extraTables, $vars["tables"]);
+
+ $plainTextHandler = new PlainTextHandler();
+ $plainTextHandler->setException($this->getException());
+ $plainTextHandler->setInspector($this->getInspector());
+ $vars["preface"] = "";
+
+ $this->templateHelper->setVariables($vars);
+
+ ob_start();
+ $this->templateHelper->render($templateFile);
+
+ $result = ob_get_clean();
+ return $result;
+ }
+
+ /**
+ * Adds an entry to the list of tables displayed in the template.
+ * The expected data is a simple associative array. Any nested arrays
+ * will be flattened with print_r
+ * @param string $label
+ * @param array $data
+ */
+ public function addDataTable($label, array $data)
+ {
+ $this->extraTables[$label] = $data;
+ }
+
+ /**
+ * Lazily adds an entry to the list of tables displayed in the table.
+ * The supplied callback argument will be called when the error is rendered,
+ * it should produce a simple associative array. Any nested arrays will
+ * be flattened with print_r.
+ *
+ * @throws InvalidArgumentException If $callback is not callable
+ * @param string $label
+ * @param callable $callback Callable returning an associative array
+ */
+ public function addDataTableCallback($label, /* callable */ $callback)
+ {
+ if (!is_callable($callback)) {
+ throw new InvalidArgumentException('Expecting callback argument to be callable');
+ }
+
+ $this->extraTables[$label] = function (\Whoops\Exception\Inspector $inspector = null) use ($callback) {
+ try {
+ $result = call_user_func($callback, $inspector);
+
+ // Only return the result if it can be iterated over by foreach().
+ return is_array($result) || $result instanceof \Traversable ? $result : [];
+ } catch (\Exception $e) {
+ // Don't allow failure to break the rendering of the original exception.
+ return [];
+ }
+ };
+ }
+
+ /**
+ * blacklist a sensitive value within one of the superglobal arrays.
+ *
+ * @param $superGlobalName string the name of the superglobal array, e.g. '_GET'
+ * @param $key string the key within the superglobal
+ */
+ public function blacklist($superGlobalName, $key)
+ {
+ $this->blacklist[$superGlobalName][] = $key;
+ }
+
+ /**
+ * Returns all the extra data tables registered with this handler.
+ * Optionally accepts a 'label' parameter, to only return the data
+ * table under that label.
+ * @param string|null $label
+ * @return array[]|callable
+ */
+ public function getDataTables($label = null)
+ {
+ if ($label !== null) {
+ return isset($this->extraTables[$label]) ?
+ $this->extraTables[$label] : [];
+ }
+
+ return $this->extraTables;
+ }
+
+ /**
+ * Allows to disable all attempts to dynamically decide whether to
+ * handle or return prematurely.
+ * Set this to ensure that the handler will perform no matter what.
+ * @param bool|null $value
+ * @return bool|null
+ */
+ public function handleUnconditionally($value = null)
+ {
+ if (func_num_args() == 0) {
+ return $this->handleUnconditionally;
+ }
+
+ $this->handleUnconditionally = (bool) $value;
+ }
+
+ /**
+ * Adds an editor resolver, identified by a string
+ * name, and that may be a string path, or a callable
+ * resolver. If the callable returns a string, it will
+ * be set as the file reference's href attribute.
+ *
+ * @example
+ * $run->addEditor('macvim', "mvim://open?url=file://%file&line=%line")
+ * @example
+ * $run->addEditor('remove-it', function($file, $line) {
+ * unlink($file);
+ * return "http://stackoverflow.com";
+ * });
+ * @param string $identifier
+ * @param string $resolver
+ */
+ public function addEditor($identifier, $resolver)
+ {
+ $this->editors[$identifier] = $resolver;
+ }
+
+ /**
+ * Set the editor to use to open referenced files, by a string
+ * identifier, or a callable that will be executed for every
+ * file reference, with a $file and $line argument, and should
+ * return a string.
+ *
+ * @example
+ * $run->setEditor(function($file, $line) { return "file:///{$file}"; });
+ * @example
+ * $run->setEditor('sublime');
+ *
+ * @throws InvalidArgumentException If invalid argument identifier provided
+ * @param string|callable $editor
+ */
+ public function setEditor($editor)
+ {
+ if (!is_callable($editor) && !isset($this->editors[$editor])) {
+ throw new InvalidArgumentException(
+ "Unknown editor identifier: $editor. Known editors:" .
+ implode(",", array_keys($this->editors))
+ );
+ }
+
+ $this->editor = $editor;
+ }
+
+ /**
+ * Given a string file path, and an integer file line,
+ * executes the editor resolver and returns, if available,
+ * a string that may be used as the href property for that
+ * file reference.
+ *
+ * @throws InvalidArgumentException If editor resolver does not return a string
+ * @param string $filePath
+ * @param int $line
+ * @return string|bool
+ */
+ public function getEditorHref($filePath, $line)
+ {
+ $editor = $this->getEditor($filePath, $line);
+
+ if (empty($editor)) {
+ return false;
+ }
+
+ // Check that the editor is a string, and replace the
+ // %line and %file placeholders:
+ if (!isset($editor['url']) || !is_string($editor['url'])) {
+ throw new UnexpectedValueException(
+ __METHOD__ . " should always resolve to a string or a valid editor array; got something else instead."
+ );
+ }
+
+ $editor['url'] = str_replace("%line", rawurlencode($line), $editor['url']);
+ $editor['url'] = str_replace("%file", rawurlencode($filePath), $editor['url']);
+
+ return $editor['url'];
+ }
+
+ /**
+ * Given a boolean if the editor link should
+ * act as an Ajax request. The editor must be a
+ * valid callable function/closure
+ *
+ * @throws UnexpectedValueException If editor resolver does not return a boolean
+ * @param string $filePath
+ * @param int $line
+ * @return bool
+ */
+ public function getEditorAjax($filePath, $line)
+ {
+ $editor = $this->getEditor($filePath, $line);
+
+ // Check that the ajax is a bool
+ if (!isset($editor['ajax']) || !is_bool($editor['ajax'])) {
+ throw new UnexpectedValueException(
+ __METHOD__ . " should always resolve to a bool; got something else instead."
+ );
+ }
+ return $editor['ajax'];
+ }
+
+ /**
+ * @param string $title
+ * @return void
+ */
+ public function setPageTitle($title)
+ {
+ $this->pageTitle = (string) $title;
+ }
+
+ /**
+ * @return string
+ */
+ public function getPageTitle()
+ {
+ return $this->pageTitle;
+ }
+
+ /**
+ * Adds a path to the list of paths to be searched for
+ * resources.
+ *
+ * @throws InvalidArgumentException If $path is not a valid directory
+ *
+ * @param string $path
+ * @return void
+ */
+ public function addResourcePath($path)
+ {
+ if (!is_dir($path)) {
+ throw new InvalidArgumentException(
+ "'$path' is not a valid directory"
+ );
+ }
+
+ array_unshift($this->searchPaths, $path);
+ }
+
+ /**
+ * Adds a custom css file to be loaded.
+ *
+ * @param string $name
+ * @return void
+ */
+ public function addCustomCss($name)
+ {
+ $this->customCss = $name;
+ }
+
+ /**
+ * @return array
+ */
+ public function getResourcePaths()
+ {
+ return $this->searchPaths;
+ }
+
+ /**
+ * @deprecated
+ *
+ * @return string
+ */
+ public function getResourcesPath()
+ {
+ $allPaths = $this->getResourcePaths();
+
+ // Compat: return only the first path added
+ return end($allPaths) ?: null;
+ }
+
+ /**
+ * @deprecated
+ *
+ * @param string $resourcesPath
+ * @return void
+ */
+ public function setResourcesPath($resourcesPath)
+ {
+ $this->addResourcePath($resourcesPath);
+ }
+
+ /**
+ * Return the application paths.
+ *
+ * @return array
+ */
+ public function getApplicationPaths()
+ {
+ return $this->applicationPaths;
+ }
+
+ /**
+ * Set the application paths.
+ *
+ * @param array $applicationPaths
+ */
+ public function setApplicationPaths($applicationPaths)
+ {
+ $this->applicationPaths = $applicationPaths;
+ }
+
+ /**
+ * Set the application root path.
+ *
+ * @param string $applicationRootPath
+ */
+ public function setApplicationRootPath($applicationRootPath)
+ {
+ $this->templateHelper->setApplicationRootPath($applicationRootPath);
+ }
+
+ /**
+ * Given a boolean if the editor link should
+ * act as an Ajax request. The editor must be a
+ * valid callable function/closure
+ *
+ * @param string $filePath
+ * @param int $line
+ * @return array
+ */
+ protected function getEditor($filePath, $line)
+ {
+ if (!$this->editor || (!is_string($this->editor) && !is_callable($this->editor))) {
+ return [];
+ }
+
+ if (is_string($this->editor) && isset($this->editors[$this->editor]) && !is_callable($this->editors[$this->editor])) {
+ return [
+ 'ajax' => false,
+ 'url' => $this->editors[$this->editor],
+ ];
+ }
+
+ if (is_callable($this->editor) || (isset($this->editors[$this->editor]) && is_callable($this->editors[$this->editor]))) {
+ if (is_callable($this->editor)) {
+ $callback = call_user_func($this->editor, $filePath, $line);
+ } else {
+ $callback = call_user_func($this->editors[$this->editor], $filePath, $line);
+ }
+
+ if (is_string($callback)) {
+ return [
+ 'ajax' => false,
+ 'url' => $callback,
+ ];
+ }
+
+ return [
+ 'ajax' => isset($callback['ajax']) ? $callback['ajax'] : false,
+ 'url' => isset($callback['url']) ? $callback['url'] : $callback,
+ ];
+ }
+
+ return [];
+ }
+
+ /**
+ * @return \Throwable
+ */
+ protected function getException()
+ {
+ return $this->exception;
+ }
+
+ /**
+ * @return Inspector
+ */
+ protected function getInspector()
+ {
+ return $this->inspector;
+ }
+
+ /**
+ * Finds a resource, by its relative path, in all available search paths.
+ * The search is performed starting at the last search path, and all the
+ * way back to the first, enabling a cascading-type system of overrides
+ * for all resources.
+ *
+ * @throws RuntimeException If resource cannot be found in any of the available paths
+ *
+ * @param string $resource
+ * @return string
+ */
+ protected function getResource($resource)
+ {
+ // If the resource was found before, we can speed things up
+ // by caching its absolute, resolved path:
+ if (isset($this->resourceCache[$resource])) {
+ return $this->resourceCache[$resource];
+ }
+
+ // Search through available search paths, until we find the
+ // resource we're after:
+ foreach ($this->searchPaths as $path) {
+ $fullPath = $path . "/$resource";
+
+ if (is_file($fullPath)) {
+ // Cache the result:
+ $this->resourceCache[$resource] = $fullPath;
+ return $fullPath;
+ }
+ }
+
+ // If we got this far, nothing was found.
+ throw new RuntimeException(
+ "Could not find resource '$resource' in any resource paths."
+ . "(searched: " . join(", ", $this->searchPaths). ")"
+ );
+ }
+
+ /**
+ * Checks all values within the given superGlobal array.
+ * Blacklisted values will be replaced by a equal length string cointaining only '*' characters.
+ *
+ * We intentionally dont rely on $GLOBALS as it depends on 'auto_globals_jit' php.ini setting.
+ *
+ * @param array $superGlobal One of the superglobal arrays
+ * @param string $superGlobalName the name of the superglobal array, e.g. '_GET'
+ * @return array $values without sensitive data
+ */
+ private function masked(array $superGlobal, $superGlobalName)
+ {
+ $blacklisted = $this->blacklist[$superGlobalName];
+
+ $values = $superGlobal;
+ foreach($blacklisted as $key) {
+ if (isset($superGlobal[$key])) {
+ $values[$key] = str_repeat('*', strlen($superGlobal[$key]));
+ }
+ }
+ return $values;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Error/Renderer/XmlRenderer.php b/login/app/sprinkles/core/src/Error/Renderer/XmlRenderer.php
new file mode 100755
index 0000000..52e71cf
--- /dev/null
+++ b/login/app/sprinkles/core/src/Error/Renderer/XmlRenderer.php
@@ -0,0 +1,48 @@
+exception;
+ $xml = "\n UserFrosting Application Error \n";
+ if ($this->displayErrorDetails) {
+ do {
+ $xml .= " \n";
+ $xml .= " " . get_class($e) . " \n";
+ $xml .= " " . $e->getCode() . "
\n";
+ $xml .= " " . $this->createCdataSection($e->getMessage()) . " \n";
+ $xml .= " " . $e->getFile() . " \n";
+ $xml .= " " . $e->getLine() . " \n";
+ $xml .= " \n";
+ } while ($e = $e->getPrevious());
+ }
+ $xml .= " ";
+
+ return $xml;
+ }
+
+ /**
+ * Returns a CDATA section with the given content.
+ *
+ * @param string $content
+ * @return string
+ */
+ private function createCdataSection($content)
+ {
+ return sprintf('', str_replace(']]>', ']]]]>', $content));
+ }
+}
diff --git a/login/app/sprinkles/core/src/Facades/Debug.php b/login/app/sprinkles/core/src/Facades/Debug.php
new file mode 100755
index 0000000..86ef450
--- /dev/null
+++ b/login/app/sprinkles/core/src/Facades/Debug.php
@@ -0,0 +1,28 @@
+isXhr()) {
+ return 'text/html';
+ }
+
+ $acceptHeader = $request->getHeaderLine('Accept');
+ $selectedContentTypes = array_intersect(explode(',', $acceptHeader), $this->knownContentTypes);
+ $count = count($selectedContentTypes);
+
+ if ($count) {
+ $current = current($selectedContentTypes);
+
+ /**
+ * Ensure other supported content types take precedence over text/plain
+ * when multiple content types are provided via Accept header.
+ */
+ if ($current === 'text/plain' && $count > 1) {
+ return next($selectedContentTypes);
+ }
+
+ return $current;
+ }
+
+ if (preg_match('/\+(json|xml)/', $acceptHeader, $matches)) {
+ $mediaType = 'application/' . $matches[1];
+ if (in_array($mediaType, $this->knownContentTypes)) {
+ return $mediaType;
+ }
+ }
+
+ return 'text/html';
+ }
+}
diff --git a/login/app/sprinkles/core/src/Log/DatabaseHandler.php b/login/app/sprinkles/core/src/Log/DatabaseHandler.php
new file mode 100755
index 0000000..c78308c
--- /dev/null
+++ b/login/app/sprinkles/core/src/Log/DatabaseHandler.php
@@ -0,0 +1,53 @@
+classMapper = $classMapper;
+ $this->modelName = $modelIdentifier;
+ parent::__construct($level, $bubble);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected function write(array $record)
+ {
+ $log = $this->classMapper->createInstance($this->modelName, $record['extra']);
+ $log->save();
+ }
+}
diff --git a/login/app/sprinkles/core/src/Log/MixedFormatter.php b/login/app/sprinkles/core/src/Log/MixedFormatter.php
new file mode 100755
index 0000000..beae788
--- /dev/null
+++ b/login/app/sprinkles/core/src/Log/MixedFormatter.php
@@ -0,0 +1,59 @@
+jsonEncodePretty($data);
+ }
+
+ $json = $this->jsonEncodePretty($data);
+
+ if ($json === false) {
+ $json = $this->handleJsonError(json_last_error(), $data);
+ }
+
+ return $json;
+ }
+
+ /**
+ * @param mixed $data
+ * @return string JSON encoded data or null on failure
+ */
+ private function jsonEncodePretty($data)
+ {
+ if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
+ return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
+ }
+
+ return json_encode($data);
+ }
+}
diff --git a/login/app/sprinkles/core/src/Mail/EmailRecipient.php b/login/app/sprinkles/core/src/Mail/EmailRecipient.php
new file mode 100755
index 0000000..0b9381a
--- /dev/null
+++ b/login/app/sprinkles/core/src/Mail/EmailRecipient.php
@@ -0,0 +1,136 @@
+ value) to use when rendering an email template for this recipient.
+ */
+ protected $params = [];
+
+ /**
+ * @var array A list of CCs for this recipient. Each CC is an associative array with `email` and `name` properties.
+ */
+ protected $cc = [];
+
+ /**
+ * @var array A list of BCCs for this recipient. Each BCC is an associative array with `email` and `name` properties.
+ */
+ protected $bcc = [];
+
+ /**
+ * Create a new EmailRecipient instance.
+ *
+ * @param string $email The primary recipient email address.
+ * @param string $name The primary recipient name.
+ * @param array $params An array of template parameters to render the email message with for this particular recipient.
+ */
+ public function __construct($email, $name = "", $params = [])
+ {
+ $this->email = $email;
+ $this->name = $name;
+ $this->params = $params;
+ }
+
+ /**
+ * Add a CC for this primary recipient.
+ *
+ * @param string $email The CC recipient email address.
+ * @param string $name The CC recipient name.
+ */
+ public function cc($email, $name = "")
+ {
+ $this->cc[] = [
+ "email" => $email,
+ "name" => $name
+ ];
+ }
+
+ /**
+ * Add a BCC for this primary recipient.
+ *
+ * @param string $email The BCC recipient email address.
+ * @param string $name The BCC recipient name.
+ */
+ public function bcc($email, $name = "")
+ {
+ $this->bcc[] = [
+ "email" => $email,
+ "name" => $name
+ ];
+ }
+
+ /**
+ * Get the primary recipient email address.
+ *
+ * @return string the primary recipient email address.
+ */
+ public function getEmail()
+ {
+ return $this->email;
+ }
+
+ /**
+ * Get the primary recipient name.
+ *
+ * @return string the primary recipient name.
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Get the parameters to use when rendering the template this recipient.
+ *
+ * @return array The parameters (name => value) to use when rendering an email template for this recipient.
+ */
+ public function getParams()
+ {
+ return $this->params;
+ }
+
+ /**
+ * Get the list of CCs for this recipient.
+ *
+ * @return array A list of CCs for this recipient. Each CC is an associative array with `email` and `name` properties.
+ */
+ public function getCCs()
+ {
+ return $this->cc;
+ }
+
+ /**
+ * Get the list of BCCs for this recipient.
+ *
+ * @return array A list of BCCs for this recipient. Each BCC is an associative array with `email` and `name` properties.
+ */
+ public function getBCCs()
+ {
+ return $this->bcc;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Mail/MailMessage.php b/login/app/sprinkles/core/src/Mail/MailMessage.php
new file mode 100755
index 0000000..29bcf15
--- /dev/null
+++ b/login/app/sprinkles/core/src/Mail/MailMessage.php
@@ -0,0 +1,186 @@
+recipients[] = $recipient;
+ return $this;
+ }
+
+ /**
+ * Clears out all recipients for this message.
+ */
+ public function clearRecipients()
+ {
+ $this->recipients = array();
+ }
+
+ /**
+ * Set sender information for this message.
+ *
+ * This is a shortcut for calling setFromEmail, setFromName, setReplyEmail, and setReplyName.
+ * @param string $fromInfo An array containing 'email', 'name', 'reply_email', and 'reply_name'.
+ */
+ public function from($fromInfo = [])
+ {
+ $this->setFromEmail(isset($fromInfo['email']) ? $fromInfo['email'] : "");
+ $this->setFromName(isset($fromInfo['name']) ? $fromInfo['name'] : null);
+ $this->setReplyEmail(isset($fromInfo['reply_email']) ? $fromInfo['reply_email'] : null);
+ $this->setReplyName(isset($fromInfo['reply_name']) ? $fromInfo['reply_name'] : null);
+
+ return $this;
+ }
+
+ /**
+ * Get the sender email address.
+ *
+ * @return string
+ */
+ public function getFromEmail()
+ {
+ return $this->fromEmail;
+ }
+
+ /**
+ * Get the sender name. Defaults to the email address if name is not set.
+ *
+ * @return string
+ */
+ public function getFromName()
+ {
+ return isset($this->fromName) ? $this->fromName : $this->getFromEmail();
+ }
+
+ /**
+ * Get the list of recipients for this message.
+ *
+ * @return EmailRecipient[]
+ */
+ public function getRecipients()
+ {
+ return $this->recipients;
+ }
+
+ /**
+ * Get the 'reply-to' address for this message. Defaults to the sender email.
+ *
+ * @return string
+ */
+ public function getReplyEmail()
+ {
+ return isset($this->replyEmail) ? $this->replyEmail : $this->getFromEmail();
+ }
+
+ /**
+ * Get the 'reply-to' name for this message. Defaults to the sender name.
+ *
+ * @return string
+ */
+ public function getReplyName()
+ {
+ return isset($this->replyName) ? $this->replyName : $this->getFromName();
+ }
+
+ /**
+ * Set the sender email address.
+ *
+ * @param string $fromEmail
+ */
+ public function setFromEmail($fromEmail)
+ {
+ $this->fromEmail = $fromEmail;
+ return $this;
+ }
+
+ /**
+ * Set the sender name.
+ *
+ * @param string $fromName
+ */
+ public function setFromName($fromName)
+ {
+ $this->fromName = $fromName;
+ return $this;
+ }
+
+ /**
+ * Set the sender 'reply-to' address.
+ *
+ * @param string $replyEmail
+ */
+ public function setReplyEmail($replyEmail)
+ {
+ $this->replyEmail = $replyEmail;
+ return $this;
+ }
+
+ /**
+ * Set the sender 'reply-to' name.
+ *
+ * @param string $replyName
+ */
+ public function setReplyName($replyName)
+ {
+ $this->replyName = $replyName;
+ return $this;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Mail/Mailer.php b/login/app/sprinkles/core/src/Mail/Mailer.php
new file mode 100755
index 0000000..5b346b4
--- /dev/null
+++ b/login/app/sprinkles/core/src/Mail/Mailer.php
@@ -0,0 +1,204 @@
+logger = $logger;
+
+ // 'true' tells PHPMailer to use exceptions instead of error codes
+ $this->phpMailer = new \PHPMailer(true);
+
+ // Configuration options
+ if (isset($config['mailer'])) {
+ if (!in_array($config['mailer'], ['smtp', 'mail', 'qmail', 'sendmail'])) {
+ throw new \phpmailerException("'mailer' must be one of 'smtp', 'mail', 'qmail', or 'sendmail'.");
+ }
+
+ if ($config['mailer'] == 'smtp') {
+ $this->phpMailer->isSMTP(true);
+ $this->phpMailer->Host = $config['host'];
+ $this->phpMailer->Port = $config['port'];
+ $this->phpMailer->SMTPAuth = $config['auth'];
+ $this->phpMailer->SMTPSecure = $config['secure'];
+ $this->phpMailer->Username = $config['username'];
+ $this->phpMailer->Password = $config['password'];
+ $this->phpMailer->SMTPDebug = $config['smtp_debug'];
+
+ if (isset($config['smtp_options'])) {
+ $this->phpMailer->SMTPOptions = $config['smtp_options'];
+ }
+ }
+
+ // Set any additional message-specific options
+ // TODO: enforce which options can be set through this subarray
+ if (isset($config['message_options'])) {
+ $this->setOptions($config['message_options']);
+ }
+ }
+
+ // Pass logger into phpMailer object
+ $this->phpMailer->Debugoutput = function($message, $level) {
+ $this->logger->debug($message);
+ };
+ }
+
+ /**
+ * Get the underlying PHPMailer object.
+ *
+ * @return \PHPMailer
+ */
+ public function getPhpMailer()
+ {
+ return $this->phpMailer;
+ }
+
+ /**
+ * Send a MailMessage message.
+ *
+ * Sends a single email to all recipients, as well as their CCs and BCCs.
+ * Since it is a single-header message, recipient-specific template data will not be included.
+ * @param MailMessage $message
+ * @param bool $clearRecipients Set to true to clear the list of recipients in the message after calling send(). This helps avoid accidentally sending a message multiple times.
+ * @throws \phpmailerException The message could not be sent.
+ */
+ public function send(MailMessage $message, $clearRecipients = true)
+ {
+ $this->phpMailer->From = $message->getFromEmail();
+ $this->phpMailer->FromName = $message->getFromName();
+ $this->phpMailer->addReplyTo($message->getReplyEmail(), $message->getReplyName());
+
+ // Add all email recipients, as well as their CCs and BCCs
+ foreach ($message->getRecipients() as $recipient) {
+ $this->phpMailer->addAddress($recipient->getEmail(), $recipient->getName());
+
+ // Add any CCs and BCCs
+ if ($recipient->getCCs()) {
+ foreach($recipient->getCCs() as $cc) {
+ $this->phpMailer->addCC($cc['email'], $cc['name']);
+ }
+ }
+
+ if ($recipient->getBCCs()) {
+ foreach($recipient->getBCCs() as $bcc) {
+ $this->phpMailer->addBCC($bcc['email'], $bcc['name']);
+ }
+ }
+ }
+
+ $this->phpMailer->Subject = $message->renderSubject();
+ $this->phpMailer->Body = $message->renderBody();
+
+ // Try to send the mail. Will throw an exception on failure.
+ $this->phpMailer->send();
+
+ // Clear recipients from the PHPMailer object for this iteration,
+ // so that we can use the same object for other emails.
+ $this->phpMailer->clearAllRecipients();
+
+ // Clear out the MailMessage's internal recipient list
+ if ($clearRecipients) {
+ $message->clearRecipients();
+ }
+ }
+
+ /**
+ * Send a MailMessage message, sending a separate email to each recipient.
+ *
+ * If the message object supports message templates, this will render the template with the corresponding placeholder values for each recipient.
+ * @param MailMessage $message
+ * @param bool $clearRecipients Set to true to clear the list of recipients in the message after calling send(). This helps avoid accidentally sending a message multiple times.
+ * @throws \phpmailerException The message could not be sent.
+ */
+ public function sendDistinct(MailMessage $message, $clearRecipients = true)
+ {
+ $this->phpMailer->From = $message->getFromEmail();
+ $this->phpMailer->FromName = $message->getFromName();
+ $this->phpMailer->addReplyTo($message->getReplyEmail(), $message->getReplyName());
+
+ // Loop through email recipients, sending customized content to each one
+ foreach ($message->getRecipients() as $recipient) {
+ $this->phpMailer->addAddress($recipient->getEmail(), $recipient->getName());
+
+ // Add any CCs and BCCs
+ if ($recipient->getCCs()) {
+ foreach($recipient->getCCs() as $cc) {
+ $this->phpMailer->addCC($cc['email'], $cc['name']);
+ }
+ }
+
+ if ($recipient->getBCCs()) {
+ foreach($recipient->getBCCs() as $bcc) {
+ $this->phpMailer->addBCC($bcc['email'], $bcc['name']);
+ }
+ }
+
+ $this->phpMailer->Subject = $message->renderSubject($recipient->getParams());
+ $this->phpMailer->Body = $message->renderBody($recipient->getParams());
+
+ // Try to send the mail. Will throw an exception on failure.
+ $this->phpMailer->send();
+
+ // Clear recipients from the PHPMailer object for this iteration,
+ // so that we can send a separate email to the next recipient.
+ $this->phpMailer->clearAllRecipients();
+ }
+
+ // Clear out the MailMessage's internal recipient list
+ if ($clearRecipients) {
+ $message->clearRecipients();
+ }
+ }
+
+ /**
+ * Set option(s) on the underlying phpMailer object.
+ *
+ * @param mixed[] $options
+ * @return Mailer
+ */
+ public function setOptions($options)
+ {
+ if (isset($options['isHtml'])) {
+ $this->phpMailer->isHTML($options['isHtml']);
+ }
+
+ foreach ($options as $name => $value) {
+ $this->phpMailer->set($name, $value);
+ }
+
+ return $this;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Mail/StaticMailMessage.php b/login/app/sprinkles/core/src/Mail/StaticMailMessage.php
new file mode 100755
index 0000000..098bbfc
--- /dev/null
+++ b/login/app/sprinkles/core/src/Mail/StaticMailMessage.php
@@ -0,0 +1,78 @@
+subject = $subject;
+ $this->body = $body;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function renderBody($params = [])
+ {
+ return $this->body;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function renderSubject($params = [])
+ {
+ return $this->subject;
+ }
+
+ /**
+ * Set the text of the message subject.
+ *
+ * @param string $subject
+ */
+ public function setSubject($subject)
+ {
+ $this->subject = $subject;
+ return $this;
+ }
+
+ /**
+ * Set the text of the message body.
+ *
+ * @param string $body
+ */
+ public function setBody($body)
+ {
+ $this->body = $body;
+ return $this;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Mail/TwigMailMessage.php b/login/app/sprinkles/core/src/Mail/TwigMailMessage.php
new file mode 100755
index 0000000..aa65240
--- /dev/null
+++ b/login/app/sprinkles/core/src/Mail/TwigMailMessage.php
@@ -0,0 +1,93 @@
+view = $view;
+
+ $twig = $this->view->getEnvironment();
+ // Must manually merge in global variables for block rendering
+ // TODO: should we keep this separate from the local parameters?
+ $this->params = $twig->getGlobals();
+
+ if ($filename !== null) {
+ $this->template = $twig->loadTemplate($filename);
+ }
+ }
+
+ /**
+ * Merge in any additional global Twig variables to use when rendering this message.
+ *
+ * @param mixed[] $params
+ */
+ public function addParams($params = [])
+ {
+ $this->params = array_replace_recursive($this->params, $params);
+ return $this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function renderSubject($params = [])
+ {
+ $params = array_replace_recursive($this->params, $params);
+ return $this->template->renderBlock('subject', $params);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function renderBody($params = [])
+ {
+ $params = array_replace_recursive($this->params, $params);
+ return $this->template->renderBlock('body', $params);
+ }
+
+ /**
+ * Sets the Twig template object for this message.
+ *
+ * @param Twig_Template $template The Twig template object, to source the content for this message.
+ */
+ public function setTemplate($template)
+ {
+ $this->template = $template;
+ return $this;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Model/UFModel.php b/login/app/sprinkles/core/src/Model/UFModel.php
new file mode 100755
index 0000000..0d9feff
--- /dev/null
+++ b/login/app/sprinkles/core/src/Model/UFModel.php
@@ -0,0 +1,27 @@
+routeGroups) {
+ $pattern = $this->processGroups() . $pattern;
+ }
+
+ // According to RFC methods are defined in uppercase (See RFC 7231)
+ $methods = array_map("strtoupper", $methods);
+
+ // Determine route signature
+ $signature = implode('-', $methods) . '-' . $pattern;
+
+ // If a route with the same signature already exists, then we must replace it
+ if (isset($this->identifiers[$signature])) {
+ $route = new \Slim\Route($methods, $pattern, $handler, $this->routeGroups, str_replace('route', '', $this->identifiers[$signature]));
+ } else {
+ $route = new \Slim\Route($methods, $pattern, $handler, $this->routeGroups, $this->routeCounter);
+ }
+
+ $this->routes[$route->getIdentifier()] = $route;
+
+ // Record identifier in reverse lookup array
+ $this->identifiers[$signature] = $route->getIdentifier();
+
+ $this->routeCounter++;
+
+ return $route;
+ }
+
+ /**
+ * Delete the cache file
+ *
+ * @access public
+ * @return bool true/false if operation is successfull
+ */
+ public function clearCache()
+ {
+ // Get Filesystem instance
+ $fs = new FileSystem;
+
+ // Make sure file exist and delete it
+ if ($fs->exists($this->cacheFile)) {
+ return $fs->delete($this->cacheFile);
+ }
+
+ // It's still considered a success if file doesn't exist
+ return true;
+ }
+}
diff --git a/login/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php b/login/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php
new file mode 100755
index 0000000..5fcffbc
--- /dev/null
+++ b/login/app/sprinkles/core/src/ServicesProvider/ServicesProvider.php
@@ -0,0 +1,618 @@
+config;
+
+ if ($config['alert.storage'] == 'cache') {
+ return new CacheAlertStream($config['alert.key'], $c->translator, $c->cache, $c->config);
+ } elseif ($config['alert.storage'] == 'session') {
+ return new SessionAlertStream($config['alert.key'], $c->translator, $c->session);
+ } else {
+ throw new \Exception("Bad alert storage handler type '{$config['alert.storage']}' specified in configuration file.");
+ }
+ };
+
+ /**
+ * Asset loader service.
+ *
+ * Loads assets from a specified relative location.
+ * Assets are Javascript, CSS, image, and other files used by your site.
+ */
+ $container['assetLoader'] = function ($c) {
+ $basePath = \UserFrosting\SPRINKLES_DIR;
+ $pattern = "/^[A-Za-z0-9_\-]+\/assets\//";
+
+ $al = new AssetLoader($basePath, $pattern);
+ return $al;
+ };
+
+ /**
+ * Asset manager service.
+ *
+ * Loads raw or compiled asset information from your bundle.config.json schema file.
+ * Assets are Javascript, CSS, image, and other files used by your site.
+ */
+ $container['assets'] = function ($c) {
+ $config = $c->config;
+ $locator = $c->locator;
+
+ // Load asset schema
+ if ($config['assets.use_raw']) {
+ $baseUrl = $config['site.uri.public'] . '/' . $config['assets.raw.path'];
+ $removePrefix = \UserFrosting\APP_DIR_NAME . \UserFrosting\DS . \UserFrosting\SPRINKLES_DIR_NAME;
+ $aub = new AssetUrlBuilder($locator, $baseUrl, $removePrefix, 'assets');
+
+ $as = new AssetBundleSchema($aub);
+
+ // Load Sprinkle assets
+ $sprinkles = $c->sprinkleManager->getSprinkleNames();
+
+ // TODO: move this out into PathBuilder and Loader classes in userfrosting/assets
+ // This would also allow us to define and load bundles in themes
+ $bundleSchemas = array_reverse($locator->findResources('sprinkles://' . $config['assets.raw.schema'], true, true));
+
+ foreach ($bundleSchemas as $schema) {
+ if (file_exists($schema)) {
+ $as->loadRawSchemaFile($schema);
+ }
+ }
+ } else {
+ $baseUrl = $config['site.uri.public'] . '/' . $config['assets.compiled.path'];
+ $aub = new CompiledAssetUrlBuilder($baseUrl);
+
+ $as = new AssetBundleSchema($aub);
+ $as->loadCompiledSchemaFile($locator->findResource("build://" . $config['assets.compiled.schema'], true, true));
+ }
+
+ $am = new AssetManager($aub, $as);
+
+ return $am;
+ };
+
+ /**
+ * Cache service.
+ *
+ * @return \Illuminate\Cache\Repository
+ */
+ $container['cache'] = function ($c) {
+
+ $config = $c->config;
+
+ if ($config['cache.driver'] == 'file') {
+ $path = $c->locator->findResource('cache://', true, true);
+ $cacheStore = new TaggableFileStore($path);
+ } elseif ($config['cache.driver'] == 'memcached') {
+ // We need to inject the prefix in the memcached config
+ $config = array_merge($config['cache.memcached'], ['prefix' => $config['cache.prefix']]);
+ $cacheStore = new MemcachedStore($config);
+ } elseif ($config['cache.driver'] == 'redis') {
+ // We need to inject the prefix in the redis config
+ $config = array_merge($config['cache.redis'], ['prefix' => $config['cache.prefix']]);
+ $cacheStore = new RedisStore($config);
+ } else {
+ throw new \Exception("Bad cache store type '{$config['cache.driver']}' specified in configuration file.");
+ }
+
+ return $cacheStore->instance();
+ };
+
+ /**
+ * Middleware to check environment.
+ *
+ * @todo We should cache the results of this, the first time that it succeeds.
+ */
+ $container['checkEnvironment'] = function ($c) {
+ $checkEnvironment = new CheckEnvironment($c->view, $c->locator, $c->cache);
+ return $checkEnvironment;
+ };
+
+ /**
+ * Class mapper.
+ *
+ * Creates an abstraction on top of class names to allow extending them in sprinkles.
+ */
+ $container['classMapper'] = function ($c) {
+ $classMapper = new ClassMapper();
+ $classMapper->setClassMapping('query_builder', 'UserFrosting\Sprinkle\Core\Database\Builder');
+ $classMapper->setClassMapping('throttle', 'UserFrosting\Sprinkle\Core\Database\Models\Throttle');
+ return $classMapper;
+ };
+
+ /**
+ * Site config service (separate from Slim settings).
+ *
+ * Will attempt to automatically determine which config file(s) to use based on the value of the UF_MODE environment variable.
+ */
+ $container['config'] = function ($c) {
+ // Grab any relevant dotenv variables from the .env file
+ try {
+ $dotenv = new Dotenv(\UserFrosting\APP_DIR);
+ $dotenv->load();
+ } catch (InvalidPathException $e) {
+ // Skip loading the environment config file if it doesn't exist.
+ }
+
+ // Get configuration mode from environment
+ $mode = getenv('UF_MODE') ?: '';
+
+ // Construct and load config repository
+ $builder = new ConfigPathBuilder($c->locator, 'config://');
+ $loader = new ArrayFileLoader($builder->buildPaths($mode));
+ $config = new Repository($loader->load());
+
+ // Construct base url from components, if not explicitly specified
+ if (!isset($config['site.uri.public'])) {
+ $base_uri = $config['site.uri.base'];
+
+ $public = new Uri(
+ $base_uri['scheme'],
+ $base_uri['host'],
+ $base_uri['port'],
+ $base_uri['path']
+ );
+
+ // Slim\Http\Uri likes to add trailing slashes when the path is empty, so this fixes that.
+ $config['site.uri.public'] = trim($public, '/');
+ }
+
+ // Hacky fix to prevent sessions from being hit too much: ignore CSRF middleware for requests for raw assets ;-)
+ // See https://github.com/laravel/framework/issues/8172#issuecomment-99112012 for more information on why it's bad to hit Laravel sessions multiple times in rapid succession.
+ $csrfBlacklist = $config['csrf.blacklist'];
+ $csrfBlacklist['^/' . $config['assets.raw.path']] = [
+ 'GET'
+ ];
+
+ $config->set('csrf.blacklist', $csrfBlacklist);
+
+ return $config;
+ };
+
+ /**
+ * Initialize CSRF guard middleware.
+ *
+ * @see https://github.com/slimphp/Slim-Csrf
+ */
+ $container['csrf'] = function ($c) {
+ $csrfKey = $c->config['session.keys.csrf'];
+
+ // Workaround so that we can pass storage into CSRF guard.
+ // If we tried to directly pass the indexed portion of `session` (for example, $c->session['site.csrf']),
+ // we would get an 'Indirect modification of overloaded element of UserFrosting\Session\Session' error.
+ // If we tried to assign an array and use that, PHP would only modify the local variable, and not the session.
+ // Since ArrayObject is an object, PHP will modify the object itself, allowing it to persist in the session.
+ if (!$c->session->has($csrfKey)) {
+ $c->session[$csrfKey] = new \ArrayObject();
+ }
+ $csrfStorage = $c->session[$csrfKey];
+
+ $onFailure = function ($request, $response, $next) {
+ $e = new BadRequestException("The CSRF code was invalid or not provided.");
+ $e->addUserMessage('CSRF_MISSING');
+ throw $e;
+
+ return $next($request, $response);
+ };
+
+ return new Guard($c->config['csrf.name'], $csrfStorage, $onFailure, $c->config['csrf.storage_limit'], $c->config['csrf.strength'], $c->config['csrf.persistent_token']);
+ };
+
+ /**
+ * Initialize Eloquent Capsule, which provides the database layer for UF.
+ *
+ * @todo construct the individual objects rather than using the facade
+ */
+ $container['db'] = function ($c) {
+ $config = $c->config;
+
+ $capsule = new Capsule;
+
+ foreach ($config['db'] as $name => $dbConfig) {
+ $capsule->addConnection($dbConfig, $name);
+ }
+
+ $queryEventDispatcher = new Dispatcher(new Container);
+
+ $capsule->setEventDispatcher($queryEventDispatcher);
+
+ // Register as global connection
+ $capsule->setAsGlobal();
+
+ // Start Eloquent
+ $capsule->bootEloquent();
+
+ if ($config['debug.queries']) {
+ $logger = $c->queryLogger;
+
+ foreach ($config['db'] as $name => $dbConfig) {
+ $capsule->connection($name)->enableQueryLog();
+ }
+
+ // Register listener
+ $queryEventDispatcher->listen(QueryExecuted::class, function ($query) use ($logger) {
+ $logger->debug("Query executed on database [{$query->connectionName}]:", [
+ 'query' => $query->sql,
+ 'bindings' => $query->bindings,
+ 'time' => $query->time . ' ms'
+ ]);
+ });
+ }
+
+ return $capsule;
+ };
+
+ /**
+ * Debug logging with Monolog.
+ *
+ * Extend this service to push additional handlers onto the 'debug' log stack.
+ */
+ $container['debugLogger'] = function ($c) {
+ $logger = new Logger('debug');
+
+ $logFile = $c->locator->findResource('log://userfrosting.log', true, true);
+
+ $handler = new StreamHandler($logFile);
+
+ $formatter = new MixedFormatter(null, null, true);
+
+ $handler->setFormatter($formatter);
+ $logger->pushHandler($handler);
+
+ return $logger;
+ };
+
+ /**
+ * Custom error-handler for recoverable errors.
+ */
+ $container['errorHandler'] = function ($c) {
+ $settings = $c->settings;
+
+ $handler = new ExceptionHandlerManager($c, $settings['displayErrorDetails']);
+
+ // Register the base HttpExceptionHandler.
+ $handler->registerHandler('\UserFrosting\Support\Exception\HttpException', '\UserFrosting\Sprinkle\Core\Error\Handler\HttpExceptionHandler');
+
+ // Register the NotFoundExceptionHandler.
+ $handler->registerHandler('\UserFrosting\Support\Exception\NotFoundException', '\UserFrosting\Sprinkle\Core\Error\Handler\NotFoundExceptionHandler');
+
+ // Register the PhpMailerExceptionHandler.
+ $handler->registerHandler('\phpmailerException', '\UserFrosting\Sprinkle\Core\Error\Handler\PhpMailerExceptionHandler');
+
+ return $handler;
+ };
+
+ /**
+ * Error logging with Monolog.
+ *
+ * Extend this service to push additional handlers onto the 'error' log stack.
+ */
+ $container['errorLogger'] = function ($c) {
+ $log = new Logger('errors');
+
+ $logFile = $c->locator->findResource('log://userfrosting.log', true, true);
+
+ $handler = new StreamHandler($logFile, Logger::WARNING);
+
+ $formatter = new LineFormatter(null, null, true);
+
+ $handler->setFormatter($formatter);
+ $log->pushHandler($handler);
+
+ return $log;
+ };
+
+ /**
+ * Factory service with FactoryMuffin.
+ *
+ * Provide access to factories for the rapid creation of objects for the purpose of testing
+ */
+ $container['factory'] = function ($c) {
+
+ // Get the path of all of the sprinkle's factories
+ $factoriesPath = $c->locator->findResources('factories://', true, true);
+
+ // Create a new Factory Muffin instance
+ $fm = new FactoryMuffin();
+
+ // Load all of the model definitions
+ $fm->loadFactories($factoriesPath);
+
+ // Set the locale. Could be the config one, but for testing English should do
+ Faker::setLocale('en_EN');
+
+ return $fm;
+ };
+
+ /**
+ * Builds search paths for locales in all Sprinkles.
+ */
+ $container['localePathBuilder'] = function ($c) {
+ $config = $c->config;
+
+ // Make sure the locale config is a valid string
+ if (!is_string($config['site.locales.default']) || $config['site.locales.default'] == '') {
+ throw new \UnexpectedValueException('The locale config is not a valid string.');
+ }
+
+ // Load the base locale file(s) as specified in the configuration
+ $locales = explode(',', $config['site.locales.default']);
+
+ return new LocalePathBuilder($c->locator, 'locale://', $locales);
+ };
+
+ /**
+ * Mail service.
+ */
+ $container['mailer'] = function ($c) {
+ $mailer = new Mailer($c->mailLogger, $c->config['mail']);
+
+ // Use UF debug settings to override any service-specific log settings.
+ if (!$c->config['debug.smtp']) {
+ $mailer->getPhpMailer()->SMTPDebug = 0;
+ }
+
+ return $mailer;
+ };
+
+ /**
+ * Mail logging service.
+ *
+ * PHPMailer will use this to log SMTP activity.
+ * Extend this service to push additional handlers onto the 'mail' log stack.
+ */
+ $container['mailLogger'] = function ($c) {
+ $log = new Logger('mail');
+
+ $logFile = $c->locator->findResource('log://userfrosting.log', true, true);
+
+ $handler = new StreamHandler($logFile);
+ $formatter = new LineFormatter(null, null, true);
+
+ $handler->setFormatter($formatter);
+ $log->pushHandler($handler);
+
+ return $log;
+ };
+
+ /**
+ * Error-handler for 404 errors. Notice that we manually create a UserFrosting NotFoundException,
+ * and a NotFoundExceptionHandler. This lets us pass through to the UF error handling system.
+ */
+ $container['notFoundHandler'] = function ($c) {
+ return function ($request, $response) use ($c) {
+ $exception = new NotFoundException;
+ $handler = new NotFoundExceptionHandler($c, $request, $response, $exception, $c->settings['displayErrorDetails']);
+ return $handler->handle();
+ };
+ };
+
+ /**
+ * Error-handler for PHP runtime errors. Notice that we just pass this through to our general-purpose
+ * error-handling service.
+ */
+ $container['phpErrorHandler'] = function ($c) {
+ return $c->errorHandler;
+ };
+
+ /**
+ * Laravel query logging with Monolog.
+ *
+ * Extend this service to push additional handlers onto the 'query' log stack.
+ */
+ $container['queryLogger'] = function ($c) {
+ $logger = new Logger('query');
+
+ $logFile = $c->locator->findResource('log://userfrosting.log', true, true);
+
+ $handler = new StreamHandler($logFile);
+
+ $formatter = new MixedFormatter(null, null, true);
+
+ $handler->setFormatter($formatter);
+ $logger->pushHandler($handler);
+
+ return $logger;
+ };
+
+ /**
+ * Override Slim's default router with the UF router.
+ */
+ $container['router'] = function ($c) {
+ $routerCacheFile = false;
+ if (isset($c->config['settings.routerCacheFile'])) {
+ $routerCacheFile = $c->config['settings.routerCacheFile'];
+ }
+
+ return (new Router)->setCacheFile($routerCacheFile);
+ };
+
+ /**
+ * Start the PHP session, with the name and parameters specified in the configuration file.
+ */
+ $container['session'] = function ($c) {
+ $config = $c->config;
+
+ // Create appropriate handler based on config
+ if ($config['session.handler'] == 'file') {
+ $fs = new FileSystem;
+ $handler = new FileSessionHandler($fs, $c->locator->findResource('session://'), $config['session.minutes']);
+ } elseif ($config['session.handler'] == 'database') {
+ $connection = $c->db->connection();
+ // Table must exist, otherwise an exception will be thrown
+ $handler = new DatabaseSessionHandler($connection, $config['session.database.table'], $config['session.minutes']);
+ } else {
+ throw new \Exception("Bad session handler type '{$config['session.handler']}' specified in configuration file.");
+ }
+
+ // Create, start and return a new wrapper for $_SESSION
+ $session = new Session($handler, $config['session']);
+ $session->start();
+
+ return $session;
+ };
+
+ /**
+ * Request throttler.
+ *
+ * Throttles (rate-limits) requests of a predefined type, with rules defined in site config.
+ */
+ $container['throttler'] = function ($c) {
+ $throttler = new Throttler($c->classMapper);
+
+ $config = $c->config;
+
+ if ($config->has('throttles') && ($config['throttles'] !== null)) {
+ foreach ($config['throttles'] as $type => $rule) {
+ if ($rule) {
+ $throttleRule = new ThrottleRule($rule['method'], $rule['interval'], $rule['delays']);
+ $throttler->addThrottleRule($type, $throttleRule);
+ } else {
+ $throttler->addThrottleRule($type, null);
+ }
+ }
+ }
+
+ return $throttler;
+ };
+
+ /**
+ * Translation service, for translating message tokens.
+ */
+ $container['translator'] = function ($c) {
+ // Load the translations
+ $paths = $c->localePathBuilder->buildPaths();
+ $loader = new ArrayFileLoader($paths);
+
+ // Create the $translator object
+ $translator = new MessageTranslator($loader->load());
+
+ return $translator;
+ };
+
+ /**
+ * Set up Twig as the view, adding template paths for all sprinkles and the Slim Twig extension.
+ *
+ * Also adds the UserFrosting core Twig extension, which provides additional functions, filters, global variables, etc.
+ */
+ $container['view'] = function ($c) {
+ $templatePaths = $c->locator->findResources('templates://', true, true);
+
+ $view = new Twig($templatePaths);
+
+ $loader = $view->getLoader();
+
+ $sprinkles = $c->sprinkleManager->getSprinkleNames();
+
+ // Add Sprinkles' templates namespaces
+ foreach ($sprinkles as $sprinkle) {
+ $path = \UserFrosting\SPRINKLES_DIR . \UserFrosting\DS .
+ $sprinkle . \UserFrosting\DS .
+ \UserFrosting\TEMPLATE_DIR_NAME . \UserFrosting\DS;
+
+ if (is_dir($path)) {
+ $loader->addPath($path, $sprinkle);
+ }
+ }
+
+ $twig = $view->getEnvironment();
+
+ if ($c->config['cache.twig']) {
+ $twig->setCache($c->locator->findResource('cache://twig', true, true));
+ }
+
+ if ($c->config['debug.twig']) {
+ $twig->enableDebug();
+ $view->addExtension(new \Twig_Extension_Debug());
+ }
+
+ // Register the Slim extension with Twig
+ $slimExtension = new TwigExtension(
+ $c->router,
+ $c->request->getUri()
+ );
+ $view->addExtension($slimExtension);
+
+ // Register the core UF extension with Twig
+ $coreExtension = new CoreExtension($c);
+ $view->addExtension($coreExtension);
+
+ return $view;
+ };
+ }
+}
diff --git a/login/app/sprinkles/core/src/Sprunje/Sprunje.php b/login/app/sprinkles/core/src/Sprunje/Sprunje.php
new file mode 100755
index 0000000..5525dc4
--- /dev/null
+++ b/login/app/sprinkles/core/src/Sprunje/Sprunje.php
@@ -0,0 +1,566 @@
+ [],
+ 'filters' => [],
+ 'lists' => [],
+ 'size' => 'all',
+ 'page' => null,
+ 'format' => 'json'
+ ];
+
+ /**
+ * Fields to allow filtering upon.
+ *
+ * @var array[string]
+ */
+ protected $filterable = [];
+
+ /**
+ * Fields to allow listing (enumeration) upon.
+ *
+ * @var array[string]
+ */
+ protected $listable = [];
+
+ /**
+ * Fields to allow sorting upon.
+ *
+ * @var array[string]
+ */
+ protected $sortable = [];
+
+ /**
+ * List of fields to exclude when processing an "_all" filter.
+ *
+ * @var array[string]
+ */
+ protected $excludeForAll = [];
+
+ /**
+ * Separator to use when splitting filter values to treat them as ORs.
+ *
+ * @var string
+ */
+ protected $orSeparator = '||';
+
+ /**
+ * Array key for the total unfiltered object count.
+ *
+ * @var string
+ */
+ protected $countKey = 'count';
+
+ /**
+ * Array key for the filtered object count.
+ *
+ * @var string
+ */
+ protected $countFilteredKey = 'count_filtered';
+
+ /**
+ * Array key for the actual result set.
+ *
+ * @var string
+ */
+ protected $rowsKey = 'rows';
+
+ /**
+ * Array key for the list of enumerated columns and their enumerations.
+ *
+ * @var string
+ */
+ protected $listableKey = 'listable';
+
+ /**
+ * Constructor.
+ *
+ * @param ClassMapper $classMapper
+ * @param mixed[] $options
+ */
+ public function __construct(ClassMapper $classMapper, array $options)
+ {
+ $this->classMapper = $classMapper;
+
+ // Validation on input data
+ $v = new Validator($options);
+ $v->rule('array', ['sorts', 'filters', 'lists']);
+ $v->rule('regex', 'sorts.*', '/asc|desc/i');
+ $v->rule('regex', 'size', '/all|[0-9]+/i');
+ $v->rule('integer', 'page');
+ $v->rule('regex', 'format', '/json|csv/i');
+
+ // TODO: translated rules
+ if(!$v->validate()) {
+ $e = new BadRequestException();
+ foreach ($v->errors() as $idx => $field) {
+ foreach($field as $eidx => $error) {
+ $e->addUserMessage($error);
+ }
+ }
+ throw $e;
+ }
+
+ $this->options = array_replace_recursive($this->options, $options);
+
+ $this->query = $this->baseQuery();
+
+ // Start a new query on any Model instances
+ if (is_a($this->baseQuery(), '\Illuminate\Database\Eloquent\Model')) {
+ $this->query = $this->baseQuery()->newQuery();
+ }
+ }
+
+ /**
+ * Extend the query by providing a callback.
+ *
+ * @param callable $callback A callback which accepts and returns a Builder instance.
+ * @return $this
+ */
+ public function extendQuery(callable $callback)
+ {
+ $this->query = $callback($this->query);
+ return $this;
+ }
+
+ /**
+ * Execute the query and build the results, and append them in the appropriate format to the response.
+ *
+ * @param ResponseInterface $response
+ * @return ResponseInterface
+ */
+ public function toResponse(Response $response)
+ {
+ $format = $this->options['format'];
+
+ if ($format == 'csv') {
+ $result = $this->getCsv();
+
+ // Prepare response
+ $settings = http_build_query($this->options);
+ $date = Carbon::now()->format('Ymd');
+ $response = $response->withAddedHeader('Content-Disposition', "attachment;filename=$date-{$this->name}-$settings.csv");
+ $response = $response->withAddedHeader('Content-Type', 'text/csv; charset=utf-8');
+ return $response->write($result);
+ // Default to JSON
+ } else {
+ $result = $this->getArray();
+ return $response->withJson($result, 200, JSON_PRETTY_PRINT);
+ }
+ }
+
+ /**
+ * Executes the sprunje query, applying all sorts, filters, and pagination.
+ *
+ * Returns an array containing `count` (the total number of rows, before filtering), `count_filtered` (the total number of rows after filtering),
+ * and `rows` (the filtered result set).
+ * @return mixed[]
+ */
+ public function getArray()
+ {
+ list($count, $countFiltered, $rows) = $this->getModels();
+
+ // Return sprunjed results
+ return [
+ $this->countKey => $count,
+ $this->countFilteredKey => $countFiltered,
+ $this->rowsKey => $rows->values()->toArray(),
+ $this->listableKey => $this->getListable()
+ ];
+ }
+
+ /**
+ * Run the query and build a CSV object by flattening the resulting collection. Ignores any pagination.
+ *
+ * @return SplTempFileObject
+ */
+ public function getCsv()
+ {
+ $filteredQuery = clone $this->query;
+
+ // Apply filters
+ $this->applyFilters($filteredQuery);
+
+ // Apply sorts
+ $this->applySorts($filteredQuery);
+
+ $collection = collect($filteredQuery->get());
+
+ // Perform any additional transformations on the dataset
+ $this->applyTransformations($collection);
+
+ $csv = Writer::createFromFileObject(new \SplTempFileObject());
+
+ $columnNames = [];
+
+ // Flatten collection while simultaneously building the column names from the union of each element's keys
+ $collection->transform(function ($item, $key) use (&$columnNames) {
+ $item = array_dot($item->toArray());
+ foreach ($item as $itemKey => $itemValue) {
+ if (!in_array($itemKey, $columnNames)) {
+ $columnNames[] = $itemKey;
+ }
+ }
+ return $item;
+ });
+
+ $csv->insertOne($columnNames);
+
+ // Insert the data as rows in the CSV document
+ $collection->each(function ($item) use ($csv, $columnNames) {
+ $row = [];
+ foreach ($columnNames as $itemKey) {
+ // Only add the value if it is set and not an array. Laravel's array_dot sometimes creates empty child arrays :(
+ // See https://github.com/laravel/framework/pull/13009
+ if (isset($item[$itemKey]) && !is_array($item[$itemKey])) {
+ $row[] = $item[$itemKey];
+ } else {
+ $row[] = '';
+ }
+ }
+
+ $csv->insertOne($row);
+ });
+
+ return $csv;
+ }
+
+ /**
+ * Executes the sprunje query, applying all sorts, filters, and pagination.
+ *
+ * Returns the filtered, paginated result set and the counts.
+ * @return mixed[]
+ */
+ public function getModels()
+ {
+ // Count unfiltered total
+ $count = $this->count($this->query);
+
+ // Clone the Query\Builder, Eloquent\Builder, or Relation
+ $filteredQuery = clone $this->query;
+
+ // Apply filters
+ $this->applyFilters($filteredQuery);
+
+ // Count filtered total
+ $countFiltered = $this->countFiltered($filteredQuery);
+
+ // Apply sorts
+ $this->applySorts($filteredQuery);
+
+ // Paginate
+ $this->applyPagination($filteredQuery);
+
+ $collection = collect($filteredQuery->get());
+
+ // Perform any additional transformations on the dataset
+ $this->applyTransformations($collection);
+
+ return [$count, $countFiltered, $collection];
+ }
+
+ /**
+ * Get lists of values for specified fields in 'lists' option, calling a custom lister callback when appropriate.
+ *
+ * @return array
+ */
+ public function getListable()
+ {
+ $result = [];
+ foreach ($this->listable as $name) {
+
+ // Determine if a custom filter method has been defined
+ $methodName = 'list'.studly_case($name);
+
+ if (method_exists($this, $methodName)) {
+ $result[$name] = $this->$methodName();
+ } else {
+ $result[$name] = $this->getColumnValues($name);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Get the underlying queriable object in its current state.
+ *
+ * @return Builder
+ */
+ public function getQuery()
+ {
+ return $this->query;
+ }
+
+ /**
+ * Set the underlying QueryBuilder object.
+ *
+ * @param Builder $query
+ * @return $this
+ */
+ public function setQuery($query)
+ {
+ $this->query = $query;
+ return $this;
+ }
+
+ /**
+ * Apply any filters from the options, calling a custom filter callback when appropriate.
+ *
+ * @param Builder $query
+ * @return $this
+ */
+ public function applyFilters($query)
+ {
+ foreach ($this->options['filters'] as $name => $value) {
+ // Check that this filter is allowed
+ if (($name != '_all') && !in_array($name, $this->filterable)) {
+ $e = new BadRequestException();
+ $e->addUserMessage('VALIDATE.SPRUNJE.BAD_FILTER', ['name' => $name]);
+ throw $e;
+ }
+ // Since we want to match _all_ of the fields, we wrap the field callback in a 'where' callback
+ $query->where(function ($fieldQuery) use ($name, $value) {
+ $this->buildFilterQuery($fieldQuery, $name, $value);
+ });
+ }
+
+ return $this;
+ }
+
+ /**
+ * Apply any sorts from the options, calling a custom sorter callback when appropriate.
+ *
+ * @param Builder $query
+ * @return $this
+ */
+ public function applySorts($query)
+ {
+ foreach ($this->options['sorts'] as $name => $direction) {
+ // Check that this sort is allowed
+ if (!in_array($name, $this->sortable)) {
+ $e = new BadRequestException();
+ $e->addUserMessage('VALIDATE.SPRUNJE.BAD_SORT', ['name' => $name]);
+ throw $e;
+ }
+
+ // Determine if a custom sort method has been defined
+ $methodName = 'sort'.studly_case($name);
+
+ if (method_exists($this, $methodName)) {
+ $this->$methodName($query, $direction);
+ } else {
+ $query->orderBy($name, $direction);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Apply pagination based on the `page` and `size` options.
+ *
+ * @param Builder $query
+ * @return $this
+ */
+ public function applyPagination($query)
+ {
+ if (
+ ($this->options['page'] !== null) &&
+ ($this->options['size'] !== null) &&
+ ($this->options['size'] != 'all')
+ ) {
+ $offset = $this->options['size']*$this->options['page'];
+ $query->skip($offset)
+ ->take($this->options['size']);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Match any filter in `filterable`.
+ *
+ * @param Builder $query
+ * @param mixed $value
+ * @return $this
+ */
+ protected function filterAll($query, $value)
+ {
+ foreach ($this->filterable as $name) {
+ if (studly_case($name) != 'all' && !in_array($name, $this->excludeForAll)) {
+ // Since we want to match _any_ of the fields, we wrap the field callback in a 'orWhere' callback
+ $query->orWhere(function ($fieldQuery) use ($name, $value) {
+ $this->buildFilterQuery($fieldQuery, $name, $value);
+ });
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Build the filter query for a single field.
+ *
+ * @param Builder $query
+ * @param string $name
+ * @param mixed $value
+ * @return $this
+ */
+ protected function buildFilterQuery($query, $name, $value)
+ {
+ $methodName = 'filter'.studly_case($name);
+
+ // Determine if a custom filter method has been defined
+ if (method_exists($this, $methodName)) {
+ $this->$methodName($query, $value);
+ } else {
+ $this->buildFilterDefaultFieldQuery($query, $name, $value);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Perform a 'like' query on a single field, separating the value string on the or separator and
+ * matching any of the supplied values.
+ *
+ * @param Builder $query
+ * @param string $name
+ * @param mixed $value
+ * @return $this
+ */
+ protected function buildFilterDefaultFieldQuery($query, $name, $value)
+ {
+ // Default filter - split value on separator for OR queries
+ // and search by column name
+ $values = explode($this->orSeparator, $value);
+ foreach ($values as $value) {
+ $query->orLike($name, $value);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set any transformations you wish to apply to the collection, after the query is executed.
+ *
+ * @param \Illuminate\Database\Eloquent\Collection $collection
+ * @return \Illuminate\Database\Eloquent\Collection
+ */
+ protected function applyTransformations($collection)
+ {
+ return $collection;
+ }
+
+ /**
+ * Set the initial query used by your Sprunje.
+ *
+ * @return Builder|Relation|Model
+ */
+ abstract protected function baseQuery();
+
+ /**
+ * Returns a list of distinct values for a specified column.
+ * Formats results to have a "value" and "text" attribute.
+ *
+ * @param string $column
+ * @return array
+ */
+ protected function getColumnValues($column)
+ {
+ $rawValues = $this->query->select($column)->distinct()->orderBy($column, 'asc')->get();
+ $values = [];
+ foreach ($rawValues as $raw) {
+ $values[] = [
+ 'value' => $raw[$column],
+ 'text' => $raw[$column]
+ ];
+ }
+ return $values;
+ }
+
+ /**
+ * Get the unpaginated count of items (before filtering) in this query.
+ *
+ * @param Builder $query
+ * @return int
+ */
+ protected function count($query)
+ {
+ return $query->count();
+ }
+
+ /**
+ * Get the unpaginated count of items (after filtering) in this query.
+ *
+ * @param Builder $query
+ * @return int
+ */
+ protected function countFiltered($query)
+ {
+ return $query->count();
+ }
+
+ /**
+ * Executes the sprunje query, applying all sorts, filters, and pagination.
+ *
+ * Returns an array containing `count` (the total number of rows, before filtering), `count_filtered` (the total number of rows after filtering),
+ * and `rows` (the filtered result set).
+ * @deprecated since 4.1.7 Use getArray() instead.
+ * @return mixed[]
+ */
+ public function getResults()
+ {
+ return $this->getArray();
+ }
+}
diff --git a/login/app/sprinkles/core/src/Throttle/ThrottleRule.php b/login/app/sprinkles/core/src/Throttle/ThrottleRule.php
new file mode 100755
index 0000000..b71f296
--- /dev/null
+++ b/login/app/sprinkles/core/src/Throttle/ThrottleRule.php
@@ -0,0 +1,140 @@
+setMethod($method);
+ $this->setInterval($interval);
+ $this->setDelays($delays);
+ }
+
+ /**
+ * Get the current delay on this rule for a particular number of event counts.
+ *
+ * @param Carbon\Carbon $lastEventTime The timestamp for the last countable event.
+ * @param int $count The total number of events which have occurred in an interval.
+ */
+ public function getDelay($lastEventTime, $count)
+ {
+ // Zero occurrences always maps to a delay of 0 seconds.
+ if ($count == 0) {
+ return 0;
+ }
+
+ foreach ($this->delays as $observations => $delay) {
+ // Skip any delay rules for which we haven't met the requisite number of observations
+ if ($count < $observations) {
+ continue;
+ }
+
+ // If this rule meets the observed number of events, and violates the required delay, then return the remaining time left
+ if ($lastEventTime->diffInSeconds() < $delay) {
+ return $lastEventTime->addSeconds($delay)->diffInSeconds();
+ }
+ }
+
+ return 0;
+ }
+
+ /**
+ * Gets the current mapping of attempts (int) to delays (seconds).
+ *
+ * @return int[]
+ */
+ public function getDelays()
+ {
+ return $this->delays;
+ }
+
+ /**
+ * Gets the current throttling interval (seconds).
+ *
+ * @return int
+ */
+ public function getInterval()
+ {
+ return $this->interval;
+ }
+
+ /**
+ * Gets the current throttling method ('ip' or 'data').
+ *
+ * @return string
+ */
+ public function getMethod()
+ {
+ return $this->method;
+ }
+
+ /**
+ * Sets the current mapping of attempts (int) to delays (seconds).
+ *
+ * @param int[] A mapping of minimum observation counts (x) to delays (y), in seconds.
+ */
+ public function setDelays($delays)
+ {
+ // Sort the array by key, from highest to lowest value
+ $this->delays = $delays;
+ krsort($this->delays);
+
+ return $this;
+ }
+
+ /**
+ * Sets the current throttling interval (seconds).
+ *
+ * @param int The amount of time, in seconds, to look back in determining attempts to consider.
+ */
+ public function setInterval($interval)
+ {
+ $this->interval = $interval;
+
+ return $this;
+ }
+
+ /**
+ * Sets the current throttling method ('ip' or 'data').
+ *
+ * @param string Set to 'ip' for ip-based throttling, 'data' for request-data-based throttling.
+ */
+ public function setMethod($method)
+ {
+ $this->method = $method;
+
+ return $this;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Throttle/Throttler.php b/login/app/sprinkles/core/src/Throttle/Throttler.php
new file mode 100755
index 0000000..0d42442
--- /dev/null
+++ b/login/app/sprinkles/core/src/Throttle/Throttler.php
@@ -0,0 +1,178 @@
+classMapper = $classMapper;
+ $this->throttleRules = [];
+ }
+
+ /**
+ * Add a throttling rule for a particular throttle event type.
+ *
+ * @param string $type The type of throttle event to check against.
+ * @param ThrottleRule $rule The rule to use when throttling this type of event.
+ */
+ public function addThrottleRule($type, $rule)
+ {
+ if (!($rule instanceof ThrottleRule || ($rule === null))) {
+ throw new ThrottlerException('$rule must be of type ThrottleRule (or null).');
+ }
+
+ $this->throttleRules[$type] = $rule;
+
+ return $this;
+ }
+
+ /**
+ * Check the current request against a specified throttle rule.
+ *
+ * @param string $type The type of throttle event to check against.
+ * @param mixed[] $requestData Any additional request parameters to use in checking the throttle.
+ * @return bool
+ */
+ public function getDelay($type, $requestData = [])
+ {
+ $throttleRule = $this->getRule($type);
+
+ if (is_null($throttleRule)) {
+ return 0;
+ }
+
+ // Get earliest time to start looking for throttleable events
+ $startTime = Carbon::now()
+ ->subSeconds($throttleRule->getInterval());
+
+ // Fetch all throttle events of the specified type, that match the specified rule
+ if ($throttleRule->getMethod() == 'ip') {
+ $events = $this->classMapper->staticMethod('throttle', 'where', 'type', $type)
+ ->where('created_at', '>', $startTime)
+ ->where('ip', $_SERVER['REMOTE_ADDR'])
+ ->get();
+ } else {
+ $events = $this->classMapper->staticMethod('throttle', 'where', 'type', $type)
+ ->where('created_at', '>', $startTime)
+ ->get();
+
+ // Filter out only events that match the required JSON data
+ $events = $events->filter(function ($item, $key) use ($requestData) {
+ $data = json_decode($item->request_data);
+
+ // If a field is not specified in the logged data, or it doesn't match the value we're searching for,
+ // then filter out this event from the collection.
+ foreach ($requestData as $name => $value) {
+ if (!isset($data->$name) || ($data->$name != $value)) {
+ return false;
+ }
+ }
+
+ return true;
+ });
+ }
+
+ // Check the collection of events against the specified throttle rule.
+ return $this->computeDelay($events, $throttleRule);
+ }
+
+ /**
+ * Get a registered rule of a particular type.
+ *
+ * @param string $type
+ * @throws ThrottlerException
+ * @return ThrottleRule[]
+ */
+ public function getRule($type)
+ {
+ if (!array_key_exists($type, $this->throttleRules)) {
+ throw new ThrottlerException("The throttling rule for '$type' could not be found.");
+ }
+
+ return $this->throttleRules[$type];
+ }
+
+ /**
+ * Get the current throttling rules.
+ *
+ * @return ThrottleRule[]
+ */
+ public function getThrottleRules()
+ {
+ return $this->throttleRules;
+ }
+
+ /**
+ * Log a throttleable event to the database.
+ *
+ * @param string $type the type of event
+ * @param string[] $requestData an array of field names => values that are relevant to throttling for this event (e.g. username, email, etc).
+ */
+ public function logEvent($type, $requestData = [])
+ {
+ // Just a check to make sure the rule exists
+ $throttleRule = $this->getRule($type);
+
+ if (is_null($throttleRule)) {
+ return $this;
+ }
+
+ $event = $this->classMapper->createInstance('throttle', [
+ 'type' => $type,
+ 'ip' => $_SERVER['REMOTE_ADDR'],
+ 'request_data' => json_encode($requestData)
+ ]);
+
+ $event->save();
+
+ return $this;
+ }
+
+ /**
+ * Returns the current delay for a specified throttle rule.
+ *
+ * @param Throttle[] $events a Collection of throttle events.
+ * @param ThrottleRule $throttleRule a rule representing the strategy to use for throttling a particular type of event.
+ * @return int seconds remaining until a particular event is permitted to be attempted again.
+ */
+ protected function computeDelay($events, $throttleRule)
+ {
+ // If no matching events found, then there is no delay
+ if (!$events->count()) {
+ return 0;
+ }
+
+ // Great, now we compare our delay against the most recent attempt
+ $lastEvent = $events->last();
+ return $throttleRule->getDelay($lastEvent->created_at, $events->count());
+ }
+}
diff --git a/login/app/sprinkles/core/src/Throttle/ThrottlerException.php b/login/app/sprinkles/core/src/Throttle/ThrottlerException.php
new file mode 100755
index 0000000..2fd9035
--- /dev/null
+++ b/login/app/sprinkles/core/src/Throttle/ThrottlerException.php
@@ -0,0 +1,18 @@
+ci = $ci;
+ }
+
+ /**
+ * Function that delete the Twig cache directory content
+ *
+ * @access public
+ * @return bool true/false if operation is successfull
+ */
+ public function clearCache()
+ {
+ // Get location
+ $path = $this->ci->locator->findResource('cache://twig', true, true);
+
+ // Get Filesystem instance
+ $fs = new FileSystem;
+
+ // Make sure directory exist and delete it
+ if ($fs->exists($path)) {
+ return $fs->deleteDirectory($path, true);
+ }
+
+ // It's still considered a success if directory doesn't exist yet
+ return true;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Twig/CoreExtension.php b/login/app/sprinkles/core/src/Twig/CoreExtension.php
new file mode 100755
index 0000000..6a89d12
--- /dev/null
+++ b/login/app/sprinkles/core/src/Twig/CoreExtension.php
@@ -0,0 +1,124 @@
+services = $services;
+ }
+
+ /**
+ * Get the name of this extension.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return 'userfrosting/core';
+ }
+
+ /**
+ * Adds Twig functions `getAlerts` and `translate`.
+ *
+ * @return array[\Twig_SimpleFunction]
+ */
+ public function getFunctions()
+ {
+ return array(
+ // Add Twig function for fetching alerts
+ new \Twig_SimpleFunction('getAlerts', function ($clear = true) {
+ if ($clear) {
+ return $this->services['alerts']->getAndClearMessages();
+ } else {
+ return $this->services['alerts']->messages();
+ }
+ }),
+ new \Twig_SimpleFunction('translate', function ($hook, $params = array()) {
+ return $this->services['translator']->translate($hook, $params);
+ }, [
+ 'is_safe' => ['html']
+ ])
+ );
+ }
+
+ /**
+ * Adds Twig filters `unescape`.
+ *
+ * @return array[\Twig_SimpleFilter]
+ */
+ public function getFilters()
+ {
+ return array(
+ /**
+ * Converts phone numbers to a standard format.
+ *
+ * @param String $num A unformatted phone number
+ * @return String Returns the formatted phone number
+ */
+ new \Twig_SimpleFilter('phone', function ($num) {
+ return Util::formatPhoneNumber($num);
+ }),
+ new \Twig_SimpleFilter('unescape', function ($string) {
+ return html_entity_decode($string);
+ })
+ );
+ }
+
+ /**
+ * Adds Twig global variables `site` and `assets`.
+ *
+ * @return array[mixed]
+ */
+ public function getGlobals()
+ {
+ // CSRF token name and value
+ $csrfNameKey = $this->services->csrf->getTokenNameKey();
+ $csrfValueKey = $this->services->csrf->getTokenValueKey();
+ $csrfName = $this->services->csrf->getTokenName();
+ $csrfValue = $this->services->csrf->getTokenValue();
+
+ $csrf = [
+ 'csrf' => [
+ 'keys' => [
+ 'name' => $csrfNameKey,
+ 'value' => $csrfValueKey
+ ],
+ 'name' => $csrfName,
+ 'value' => $csrfValue
+ ]
+ ];
+
+ $site = array_replace_recursive($this->services->config['site'], $csrf);
+
+ return [
+ 'site' => $site,
+ 'assets' => $this->services->assets
+ ];
+ }
+}
diff --git a/login/app/sprinkles/core/src/Util/BadClassNameException.php b/login/app/sprinkles/core/src/Util/BadClassNameException.php
new file mode 100755
index 0000000..09c4ea5
--- /dev/null
+++ b/login/app/sprinkles/core/src/Util/BadClassNameException.php
@@ -0,0 +1,18 @@
+session = $session;
+ $this->key = $key;
+
+ if (!$this->session->has($key)) {
+ $this->session[$key] = array();
+ }
+ }
+
+ /**
+ * Generates a new captcha for the user registration form.
+ *
+ * This generates a random 5-character captcha and stores it in the session with an md5 hash.
+ * Also, generates the corresponding captcha image.
+ */
+ public function generateRandomCode()
+ {
+ $md5_hash = md5(rand(0,99999));
+ $this->code = substr($md5_hash, 25, 5);
+ $enc = md5($this->code);
+
+ // Store the generated captcha value to the session
+ $this->session[$this->key] = $enc;
+
+ $this->generateImage();
+ }
+
+ /**
+ * Returns the captcha code.
+ */
+ public function getCaptcha()
+ {
+ return $this->code;
+ }
+
+ /**
+ * Returns the captcha image.
+ */
+ public function getImage()
+ {
+ return $this->image;
+ }
+
+ /**
+ * Check that the specified code, when hashed, matches the code in the session.
+ *
+ * Also, stores the specified code in the session with an md5 hash.
+ * @param string
+ * @return bool
+ */
+ public function verifyCode($code)
+ {
+ return (md5($code) == $this->session[$this->key]);
+ }
+
+ /**
+ * Generate the image for the current captcha.
+ *
+ * This generates an image as a binary string.
+ */
+ protected function generateImage()
+ {
+ $width = 150;
+ $height = 30;
+
+ $image = imagecreatetruecolor(150, 30);
+
+ //color pallette
+ $white = imagecolorallocate($image, 255, 255, 255);
+ $black = imagecolorallocate($image, 0, 0, 0);
+ $red = imagecolorallocate($image,255,0,0);
+ $yellow = imagecolorallocate($image, 255, 255, 0);
+ $dark_grey = imagecolorallocate($image, 64,64,64);
+ $blue = imagecolorallocate($image, 0,0,255);
+
+ //create white rectangle
+ imagefilledrectangle($image,0,0,150,30,$white);
+
+ //add some lines
+ for($i=0;$i<2;$i++) {
+ imageline($image,0,rand()%10,10,rand()%30,$dark_grey);
+ imageline($image,0,rand()%30,150,rand()%30,$red);
+ imageline($image,0,rand()%30,150,rand()%30,$yellow);
+ }
+
+ // RandTab color pallette
+ $randc[0] = imagecolorallocate($image, 0, 0, 0);
+ $randc[1] = imagecolorallocate($image,255,0,0);
+ $randc[2] = imagecolorallocate($image, 255, 255, 0);
+ $randc[3] = imagecolorallocate($image, 64,64,64);
+ $randc[4] = imagecolorallocate($image, 0,0,255);
+
+ //add some dots
+ for($i=0;$i<1000;$i++) {
+ imagesetpixel($image,rand()%200,rand()%50,$randc[rand()%5]);
+ }
+
+ //calculate center of text
+ $x = ( 150 - 0 - imagefontwidth( 5 ) * strlen( $this->code ) ) / 2 + 0 + 5;
+
+ //write string twice
+ imagestring($image,5, $x, 7, $this->code, $black);
+ imagestring($image,5, $x, 7, $this->code, $black);
+ //start ob
+ ob_start();
+ imagepng($image);
+
+ //get binary image data
+ $this->image = ob_get_clean();
+
+ return $this->image;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Util/CheckEnvironment.php b/login/app/sprinkles/core/src/Util/CheckEnvironment.php
new file mode 100755
index 0000000..26925d9
--- /dev/null
+++ b/login/app/sprinkles/core/src/Util/CheckEnvironment.php
@@ -0,0 +1,340 @@
+view = $view;
+ $this->locator = $locator;
+ $this->cache = $cache;
+ }
+
+ /**
+ * Invoke the CheckEnvironment middleware, performing all pre-flight checks and returning an error page if problems were found.
+ *
+ * @param \Psr\Http\Message\ServerRequestInterface $request PSR7 request
+ * @param \Psr\Http\Message\ResponseInterface $response PSR7 response
+ * @param callable $next Next middleware
+ *
+ * @return \Psr\Http\Message\ResponseInterface
+ */
+ public function __invoke($request, $response, $next)
+ {
+ $problemsFound = false;
+
+ // If production environment and no cached checks, perform environment checks
+ if ($this->isProduction() && $this->cache->get('checkEnvironment') != 'pass') {
+ $problemsFound = $this->checkAll();
+
+ // Cache if checks passed
+ if (!$problemsFound) {
+ $this->cache->forever('checkEnvironment', 'pass');
+ }
+ } elseif (!$this->isProduction()) {
+ $problemsFound = $this->checkAll();
+ }
+
+ if ($problemsFound) {
+ $results = array_merge($this->resultsFailed, $this->resultsSuccess);
+
+ $response = $this->view->render($response, 'pages/error/config-errors.html.twig', [
+ "messages" => $results
+ ]);
+ } else {
+ $response = $next($request, $response);
+ }
+
+ return $response;
+ }
+
+ /**
+ * Run through all pre-flight checks.
+ */
+ public function checkAll()
+ {
+ $problemsFound = false;
+
+ if ($this->checkApache()) $problemsFound = true;
+
+ if ($this->checkPhp()) $problemsFound = true;
+
+ if ($this->checkPdo()) $problemsFound = true;
+
+ if ($this->checkGd()) $problemsFound = true;
+
+ if ($this->checkImageFunctions()) $problemsFound = true;
+
+ if ($this->checkPermissions()) $problemsFound = true;
+
+ return $problemsFound;
+ }
+
+ /**
+ * For Apache environments, check that required Apache modules are installed.
+ */
+ public function checkApache()
+ {
+ $problemsFound = false;
+
+ // Perform some Apache checks. We may also need to do this before any routing takes place.
+ if (strpos(php_sapi_name(), 'apache') !== false) {
+
+ $require_apache_modules = ['mod_rewrite'];
+ $apache_modules = apache_get_modules();
+
+ $apache_status = [];
+
+ foreach ($require_apache_modules as $module) {
+ if (!in_array($module, $apache_modules)) {
+ $problemsFound = true;
+ $this->resultsFailed['apache-' . $module] = [
+ "title" => " Missing Apache module $module .",
+ "message" => "Please make sure that the $module
Apache module is installed and enabled. If you use shared hosting, you will need to ask your web host to do this for you.",
+ "success" => false
+ ];
+ } else {
+ $this->resultsSuccess['apache-' . $module] = [
+ "title" => " Apache module $module is installed and enabled.",
+ "message" => "Great, we found the $module
Apache module!",
+ "success" => true
+ ];
+ }
+ }
+ }
+
+ return $problemsFound;
+ }
+
+ /**
+ * Check for GD library (required for Captcha).
+ */
+ public function checkGd()
+ {
+ $problemsFound = false;
+
+ if (!(extension_loaded('gd') && function_exists('gd_info'))) {
+ $problemsFound = true;
+ $this->resultsFailed['gd'] = [
+ "title" => " GD library not installed",
+ "message" => "We could not confirm that the GD
library is installed and enabled. GD is an image processing library that UserFrosting uses to generate captcha codes for user account registration.",
+ "success" => false
+ ];
+ } else {
+ $this->resultsSuccess['gd'] = [
+ "title" => " GD library installed!",
+ "message" => "Great, you have GD
installed and enabled.",
+ "success" => true
+ ];
+ }
+
+ return $problemsFound;
+ }
+
+ /**
+ * Check that all image* functions used by Captcha exist.
+ *
+ * Some versions of GD are missing one or more of these functions, thus why we check for them explicitly.
+ */
+ public function checkImageFunctions()
+ {
+ $problemsFound = false;
+
+ $funcs = [
+ 'imagepng',
+ 'imagecreatetruecolor',
+ 'imagecolorallocate',
+ 'imagefilledrectangle',
+ 'imageline',
+ 'imagesetpixel',
+ 'imagefontwidth',
+ 'imagestring'
+ ];
+
+ foreach ($funcs as $func) {
+ if (!function_exists($func)) {
+ $problemsFound = true;
+ $this->resultsFailed['function-' . $func] = [
+ "title" => " Missing image manipulation function.",
+ "message" => "It appears that function $func
is not available. UserFrosting needs this to render captchas.",
+ "success" => false
+ ];
+ } else {
+ $this->resultsSuccess['function-' . $func] = [
+ "title" => " Function $func is available!",
+ "message" => "Sweet!",
+ "success" => true
+ ];
+ }
+ }
+
+ return $problemsFound;
+ }
+
+ /**
+ * Check that PDO is installed and enabled.
+ */
+ public function checkPdo()
+ {
+ $problemsFound = false;
+
+ if (!class_exists('PDO')) {
+ $problemsFound = true;
+ $this->resultsFailed['pdo'] = [
+ "title" => " PDO is not installed.",
+ "message" => "I'm sorry, you must have PDO installed and enabled in order for UserFrosting to access the database. If you don't know what PDO is, please see http://php.net/manual/en/book.pdo.php .",
+ "success" => false
+ ];
+ } else {
+ $this->resultsSuccess['pdo'] = [
+ "title" => " PDO is installed!",
+ "message" => "You've got PDO installed. Good job!",
+ "success" => true
+ ];
+ }
+
+ return $problemsFound;
+ }
+
+ /**
+ * Check that log, cache, and session directories are writable, and that other directories are set appropriately for the environment.
+ */
+ function checkPermissions()
+ {
+ $problemsFound = false;
+
+ $shouldBeWriteable = [
+ $this->locator->findResource('log://') => true,
+ $this->locator->findResource('cache://') => true,
+ $this->locator->findResource('session://') => true
+ ];
+
+ if ($this->isProduction()) {
+ // Should be write-protected in production!
+ $shouldBeWriteable = array_merge($shouldBeWriteable, [
+ \UserFrosting\SPRINKLES_DIR => false,
+ \UserFrosting\VENDOR_DIR => false
+ ]);
+ }
+
+ // Check for essential files & perms
+ foreach ($shouldBeWriteable as $file => $assertWriteable) {
+ $is_dir = false;
+ if (!file_exists($file)) {
+ $problemsFound = true;
+ $this->resultsFailed['file-' . $file] = [
+ "title" => " File or directory does not exist.",
+ "message" => "We could not find the file or directory $file
.",
+ "success" => false
+ ];
+ } else {
+ $writeable = is_writable($file);
+ if ($assertWriteable !== $writeable) {
+ $problemsFound = true;
+ $this->resultsFailed['file-' . $file] = [
+ "title" => " Incorrect permissions for file or directory.",
+ "message" => "$file
is "
+ . ($writeable ? "writeable" : "not writeable")
+ . ", but it should "
+ . ($assertWriteable ? "be writeable" : "not be writeable")
+ . ". Please modify the OS user or group permissions so that user "
+ . exec('whoami') . " "
+ . ($assertWriteable ? "has" : "does not have") . " write permissions for this directory.",
+ "success" => false
+ ];
+ } else {
+ $this->resultsSuccess['file-' . $file] = [
+ "title" => " File/directory check passed!",
+ "message" => "$file
exists and is correctly set as "
+ . ($writeable ? "writeable" : "not writeable")
+ . " .",
+ "success" => true
+ ];
+ }
+ }
+ }
+ return $problemsFound;
+ }
+
+ /**
+ * Check that PHP meets the minimum required version.
+ */
+ public function checkPhp()
+ {
+ $problemsFound = false;
+
+ // Check PHP version
+ if (version_compare(phpversion(), \UserFrosting\PHP_MIN_VERSION, '<')) {
+ $problemsFound = true;
+ $this->resultsFailed['phpVersion'] = [
+ "title" => " You need to upgrade your PHP installation.",
+ "message" => "I'm sorry, UserFrosting requires version " . \UserFrosting\PHP_MIN_VERSION . " or greater. Please upgrade your version of PHP, or contact your web hosting service and ask them to upgrade it for you.",
+ "success" => false
+ ];
+ } else {
+ $this->resultsSuccess['phpVersion'] = [
+ "title" => " PHP version checks out!",
+ "message" => "You're using PHP " . \UserFrosting\PHP_MIN_VERSION . "or higher. Great!",
+ "success" => true
+ ];
+ }
+
+ return $problemsFound;
+ }
+
+ /**
+ * Determine whether or not we are running in production mode.
+ *
+ * @return bool
+ */
+ public function isProduction()
+ {
+ return (getenv('UF_MODE') == 'production');
+ }
+}
diff --git a/login/app/sprinkles/core/src/Util/ClassMapper.php b/login/app/sprinkles/core/src/Util/ClassMapper.php
new file mode 100755
index 0000000..5fa0881
--- /dev/null
+++ b/login/app/sprinkles/core/src/Util/ClassMapper.php
@@ -0,0 +1,94 @@
+getClassMapping($identifier);
+
+ $params = array_slice(func_get_args(), 1);
+
+ // We must use reflection in PHP < 5.6. See http://stackoverflow.com/questions/8734522/dynamically-call-class-with-variable-number-of-parameters-in-the-constructor
+ $reflection = new \ReflectionClass($className);
+
+ return $reflection->newInstanceArgs($params);
+ }
+
+ /**
+ * Gets the fully qualified class name for a specified class identifier.
+ *
+ * @param string $identifier
+ * @return string
+ */
+ public function getClassMapping($identifier)
+ {
+ if (isset($this->classMappings[$identifier])) {
+ return $this->classMappings[$identifier];
+ } else {
+ throw new \OutOfBoundsException("There is no class mapped to the identifier '$identifier'.");
+ }
+ }
+
+ /**
+ * Assigns a fully qualified class name to a specified class identifier.
+ *
+ * @param string $identifier
+ * @param string $className
+ * @return ClassMapper
+ */
+ public function setClassMapping($identifier, $className)
+ {
+ // Check that class exists
+ if (!class_exists($className)) {
+ throw new BadClassNameException("Unable to find the class '$className'." );
+ }
+
+ $this->classMappings[$identifier] = $className;
+
+ return $this;
+ }
+
+ /**
+ * Call a static method for a specified class.
+ *
+ * @param string $identifier The identifier for the class, e.g. 'user'
+ * @param string $methodName The method to be invoked.
+ * @param mixed ...$arg Whatever needs to be passed to the method.
+ */
+ public function staticMethod($identifier, $methodName)
+ {
+ $className = $this->getClassMapping($identifier);
+
+ $params = array_slice(func_get_args(), 2);
+
+ return call_user_func_array("$className::$methodName", $params);
+ }
+}
diff --git a/login/app/sprinkles/core/src/Util/EnvironmentInfo.php b/login/app/sprinkles/core/src/Util/EnvironmentInfo.php
new file mode 100755
index 0000000..aba9837
--- /dev/null
+++ b/login/app/sprinkles/core/src/Util/EnvironmentInfo.php
@@ -0,0 +1,68 @@
+getPdo();
+ $results = [];
+
+ try {
+ $results['type'] = $pdo->getAttribute(\PDO::ATTR_DRIVER_NAME);
+ } catch (Exception $e) {
+ $results['type'] = "Unknown";
+ }
+
+ try {
+ $results['version'] = $pdo->getAttribute(\PDO::ATTR_SERVER_VERSION);
+ } catch (Exception $e) {
+ $results['version'] = "";
+ }
+
+ return $results;
+ }
+
+ /**
+ * Test whether a DB connection can be established.
+ *
+ * @return bool true if the connection can be established, false otherwise.
+ */
+ public static function canConnectToDatabase()
+ {
+ try {
+ Capsule::connection()->getPdo();
+ } catch (\PDOException $e) {
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/login/app/sprinkles/core/src/Util/ShutdownHandler.php b/login/app/sprinkles/core/src/Util/ShutdownHandler.php
new file mode 100755
index 0000000..e7a6903
--- /dev/null
+++ b/login/app/sprinkles/core/src/Util/ShutdownHandler.php
@@ -0,0 +1,167 @@
+ci = $ci;
+ $this->displayErrorInfo = $displayErrorInfo;
+ }
+
+ /**
+ * Register this class with the shutdown handler.
+ *
+ * @return void
+ */
+ public function register()
+ {
+ register_shutdown_function([$this, 'fatalHandler']);
+ }
+
+ /**
+ * Set up the fatal error handler, so that we get a clean error message and alert instead of a WSOD.
+ */
+ public function fatalHandler()
+ {
+ $error = error_get_last();
+ $fatalErrorTypes = [
+ E_ERROR,
+ E_PARSE,
+ E_CORE_ERROR,
+ E_COMPILE_ERROR,
+ E_RECOVERABLE_ERROR
+ ];
+
+ // Handle fatal errors and parse errors
+ if ($error !== NULL && in_array($error['type'], $fatalErrorTypes)) {
+
+ // Build the appropriate error message (debug or client)
+ if ($this->displayErrorInfo) {
+ $errorMessage = $this->buildErrorInfoMessage($error);
+ } else {
+ $errorMessage = "Oops, looks like our server might have goofed. If you're an admin, please ensure that php.log_errors
is enabled, and then check the PHP error log.";
+ }
+
+ // For CLI, just print the message and exit.
+ if (php_sapi_name() === 'cli') {
+ exit($errorMessage . PHP_EOL);
+ }
+
+ // For all other environments, print a debug response for the requested data type
+ echo $this->buildErrorPage($errorMessage);
+
+ // If this is an AJAX request and AJAX debugging is turned off, write message to the alert stream
+ if ($this->ci->request->isXhr() && !$this->ci->config['site.debug.ajax']) {
+ if ($this->ci->alerts && is_object($this->ci->alerts)) {
+ $this->ci->alerts->addMessageTranslated('danger', $errorMessage);
+ }
+ }
+
+ header('HTTP/1.1 500 Internal Server Error');
+ exit();
+ }
+ }
+
+ /**
+ * Build the error message string.
+ *
+ * @param array $error
+ * @return string
+ */
+ protected function buildErrorInfoMessage(array $error)
+ {
+ $errfile = $error['file'];
+ $errline = (string) $error['line'];
+ $errstr = $error['message'];
+
+ $errorTypes = [
+ E_ERROR => 'Fatal error',
+ E_PARSE => 'Parse error',
+ E_CORE_ERROR => 'PHP core error',
+ E_COMPILE_ERROR => 'Zend compile error',
+ E_RECOVERABLE_ERROR => 'Catchable fatal error'
+ ];
+
+ return "" . $errorTypes[$error['type']] . " : $errstr in $errfile on line $errline ";
+ }
+
+ /**
+ * Build an error response of the appropriate type as determined by the request's Accept header.
+ *
+ * @param string $message
+ * @return string
+ */
+ protected function buildErrorPage($message)
+ {
+ $contentType = $this->determineContentType($this->ci->request, $this->ci->config['site.debug.ajax']);
+
+ switch ($contentType) {
+ case 'application/json':
+ $error = ['message' => $message];
+ return json_encode($error, JSON_PRETTY_PRINT);
+
+ case 'text/html':
+ return $this->buildHtmlErrorPage($message);
+
+ default:
+ case 'text/plain':
+ return $message;
+ }
+ }
+
+ /**
+ * Build an HTML error page from an error string.
+ *
+ * @param string $errorMessage
+ * @return string
+ */
+ protected function buildHtmlErrorPage($message)
+ {
+ $title = 'UserFrosting Application Error';
+ $html = "$message
";
+
+ return sprintf(
+ " " .
+ "%s %s %s",
+ $title,
+ $title,
+ $html
+ );
+ }
+}
diff --git a/login/app/sprinkles/core/src/Util/Util.php b/login/app/sprinkles/core/src/Util/Util.php
new file mode 100755
index 0000000..ae551cf
--- /dev/null
+++ b/login/app/sprinkles/core/src/Util/Util.php
@@ -0,0 +1,173 @@
+'.str_repeat( ' ', $newLineLevel);
+ }
+
+ $result .= $char.$post;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Generate a random phrase, consisting of a specified number of adjectives, followed by a noun.
+ *
+ * @param int $numAdjectives
+ * @param int $maxLength
+ * @param int $maxTries
+ * @param string $separator
+ * @return string
+ */
+ static public function randomPhrase($numAdjectives, $maxLength = 9999999, $maxTries = 10, $separator = '-')
+ {
+ $adjectives = include('extra://adjectives.php');
+ $nouns = include('extra://nouns.php');
+
+ for ($n = 0; $n < $maxTries; $n++) {
+ $keys = array_rand($adjectives, $numAdjectives);
+ $matches = array_only($adjectives, $keys);
+
+ $result = implode($separator, $matches);
+ $result .= $separator . $nouns[array_rand($nouns)];
+ $result = str_slug($result, $separator);
+ if (strlen($result) < $maxLength) {
+ return $result;
+ }
+ }
+
+ return '';
+ }
+}
diff --git a/login/app/sprinkles/core/templates/forms/csrf.html.twig b/login/app/sprinkles/core/templates/forms/csrf.html.twig
new file mode 100755
index 0000000..989f88c
--- /dev/null
+++ b/login/app/sprinkles/core/templates/forms/csrf.html.twig
@@ -0,0 +1,2 @@
+
+
diff --git a/login/app/sprinkles/core/templates/mail/.gitkeep b/login/app/sprinkles/core/templates/mail/.gitkeep
new file mode 100755
index 0000000..e69de29
diff --git a/login/app/sprinkles/core/templates/modals/modal.html.twig b/login/app/sprinkles/core/templates/modals/modal.html.twig
new file mode 100755
index 0000000..cb17dfd
--- /dev/null
+++ b/login/app/sprinkles/core/templates/modals/modal.html.twig
@@ -0,0 +1,27 @@
+{# Base layout for modals.
+#}
+
+{# Conditional block. See http://stackoverflow.com/a/13806784/2970321 #}
+{% set _modal_footer = block('modal_footer') %}
+
+
+
+
+
+
+
+
+ {% block modal_body %}
+ {% endblock %}
+
+ {% if _modal_footer is not empty %}
+
+ {% endif %}
+
+
+
diff --git a/login/app/sprinkles/core/templates/navigation/breadcrumb.html.twig b/login/app/sprinkles/core/templates/navigation/breadcrumb.html.twig
new file mode 100755
index 0000000..e95e302
--- /dev/null
+++ b/login/app/sprinkles/core/templates/navigation/breadcrumb.html.twig
@@ -0,0 +1,4 @@
+
+ {{site.title}}
+ {{ page_title | raw }}
+
\ No newline at end of file
diff --git a/login/app/sprinkles/core/templates/navigation/main-nav.html.twig b/login/app/sprinkles/core/templates/navigation/main-nav.html.twig
new file mode 100755
index 0000000..3acbb87
--- /dev/null
+++ b/login/app/sprinkles/core/templates/navigation/main-nav.html.twig
@@ -0,0 +1,31 @@
+
+
+
+
\ No newline at end of file
diff --git a/login/app/sprinkles/core/templates/pages/about.html.twig b/login/app/sprinkles/core/templates/pages/about.html.twig
new file mode 100755
index 0000000..95f9b72
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/about.html.twig
@@ -0,0 +1,173 @@
+{% extends "pages/abstract/default.html.twig" %}
+
+{% set page_active = "about" %}
+
+{# Overrides blocks in head of base template #}
+{% block page_title %}{{translate("ABOUT")}}{% endblock %}
+
+{% block page_description %}All about my UserFrosting website.{% endblock %}
+
+{% block body_matter %}
+
+
+
+
+
+
+
+
About Modern Business
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sed voluptate nihil eum consectetur similique? Consectetur, quod, incidunt, harum nisi dolores delectus reprehenderit voluptatem perferendis dicta dolorem non blanditiis ex fugiat.
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe, magni, aperiam vitae illum voluptatum aut sequi impedit non velit ab ea pariatur sint quidem corporis eveniet. Odit, temporibus reprehenderit dolorum!
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Et, consequuntur, modi mollitia corporis ipsa voluptate corrupti eum ratione ex ea praesentium quibusdam? Aut, in eum facere corrupti necessitatibus perspiciatis quis?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
John Smith
+ Job Title
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste saepe et quisquam nesciunt maxime.
+
+
+
+
+
+
+
+
+
John Smith
+ Job Title
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste saepe et quisquam nesciunt maxime.
+
+
+
+
+
+
+
+
+
John Smith
+ Job Title
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste saepe et quisquam nesciunt maxime.
+
+
+
+
+
+
+
+
+
John Smith
+ Job Title
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste saepe et quisquam nesciunt maxime.
+
+
+
+
+
+
+
+
+
John Smith
+ Job Title
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste saepe et quisquam nesciunt maxime.
+
+
+
+
+
+
+
+
+
John Smith
+ Job Title
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste saepe et quisquam nesciunt maxime.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{% endblock %}
diff --git a/login/app/sprinkles/core/templates/pages/abstract/base.html.twig b/login/app/sprinkles/core/templates/pages/abstract/base.html.twig
new file mode 100755
index 0000000..43e839e
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/abstract/base.html.twig
@@ -0,0 +1,103 @@
+{# This is the base layout template for all pages. #}
+
+{% block page %}
+
+
+ {% block head %}
+
+
+
+
+
+
+
+
+
+ {{ site.title }} | {% block page_title %}New Page{% endblock %}
+
+ {% include "pages/partials/favicons.html.twig" %}
+
+ {# Use this block to add extra content in page head without having to override the entire base layout #}
+ {% block head_extra %}{% endblock %}
+
+ {% block stylesheets %}
+ {# Override this block in a child layout template or page template to override site-level stylesheets. #}
+ {% block stylesheets_site %}
+
+ {{ assets.css() | raw }}
+ {% endblock %}
+
+ {# Override this block in a child layout template or page template to specify or override stylesheets for groups of similar pages. #}
+ {% block stylesheets_page_group %}
+ {% endblock %}
+
+ {# Override this block in a child layout template or page template to specify or override page-level stylesheets. #}
+ {% block stylesheets_page %}
+ {% endblock %}
+ {% endblock %}
+
+ {# Site author link #}
+ {% if site.uri.author %}
+
+ {% endif %}
+
+ {# Site publisher link #}
+ {% if site.uri.publisher %}
+
+ {% endif %}
+
+ {# Canonical page link #}
+ {% if block('page_canonical') %}
+
+ {% endif %}
+
+
+
+
+
+ {% include "pages/partials/analytics.html.twig" %}
+
+ {% endblock %}
+
+ {% block body %}
+
+ {# Page Content #}
+ {% block content %}{% endblock %}
+
+ {# Handlebars template for uf-alerts. #}
+ {% block uf_alerts_template %}
+ {% include "pages/partials/alerts.html.twig" %}
+ {% endblock %}
+
+
+
+
+ {% block scripts %}
+ {# Override this block in a child layout template or page template to override site-level scripts. #}
+ {% block scripts_site %}
+
+
+
+
+
+ {{ assets.js() | raw }}
+ {% endblock %}
+
+ {# Override this block in a child layout template or page template to specify or override scripts for groups of similar pages. #}
+ {% block scripts_page_group %}
+ {% endblock %}
+
+ {# Override this block in a child layout template or page template to specify or override page-level scripts. #}
+ {% block scripts_page %}
+ {% endblock %}
+ {% endblock %}
+
+
+ {% endblock %}
+
+{% endblock %}
diff --git a/login/app/sprinkles/core/templates/pages/abstract/default.html.twig b/login/app/sprinkles/core/templates/pages/abstract/default.html.twig
new file mode 100755
index 0000000..625dea1
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/abstract/default.html.twig
@@ -0,0 +1,45 @@
+{% extends "pages/abstract/base.html.twig" %}
+
+{% block stylesheets_page_group %}
+{% endblock %}
+
+{% block body_attributes %}
+ class="hold-transition skin-{{site.AdminLTE.skin}} layout-top-nav"
+{% endblock %}
+
+{% block content %}
+
+
+
+
+ {% include "navigation/main-nav.html.twig" %}
+
+
+
+
+
+
+ {% block content_header %}
+
+ {% endblock %}
+
+ {% block body_matter %}{% endblock %}
+
+
+
+
+
+ {% block footer %}
+ {% include "pages/partials/footer.html.twig" %}
+ {% endblock %}
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/login/app/sprinkles/core/templates/pages/abstract/error.html.twig b/login/app/sprinkles/core/templates/pages/abstract/error.html.twig
new file mode 100755
index 0000000..c7c7205
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/abstract/error.html.twig
@@ -0,0 +1,32 @@
+{# This is the layout template for error pages. Note that there is no navigation bar. #}
+{% extends "pages/abstract/base.html.twig" %}
+
+{% block page_title %}{{ translate('ERROR.TITLE') }}{% endblock %}
+
+{% block page_description %}{{ translate('ERROR.DESCRIPTION') }}{% endblock %}
+
+{% block body %}
+
+
+
+
+ {% block headline %}
{% endblock %}
+
+
+
{% block heading %} {{ translate('ERROR.ENCOUNTERED') }}{% endblock %}
+
+ {% block content %}
+ {% if messages %}
{{ translate('ERROR.DETAIL') }}
{% endif %}
+ {% for message in messages %}
+
{{ translate(message.message, message.parameters) }}
+ {% endfor %}
+
{{ translate('ERROR.RETURN', {url : site.uri.public})|raw }}
+ {% endblock %}
+
+
+
+
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/login/app/sprinkles/core/templates/pages/error/400.html.twig b/login/app/sprinkles/core/templates/pages/error/400.html.twig
new file mode 100755
index 0000000..3570df8
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/error/400.html.twig
@@ -0,0 +1,9 @@
+{% extends "pages/abstract/error.html.twig" %}
+
+{% block page_title %}{{ translate('ERROR.400.TITLE') }}{% endblock %}
+
+{% block page_description %}{{ translate('ERROR.400.DESCRIPTION') }}{% endblock %}
+
+{% block headline %}400 {% endblock %}
+
+{% block heading %} {{ translate('ERROR.400.TITLE') }}{% endblock %}
diff --git a/login/app/sprinkles/core/templates/pages/error/404.html.twig b/login/app/sprinkles/core/templates/pages/error/404.html.twig
new file mode 100755
index 0000000..6630e1b
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/error/404.html.twig
@@ -0,0 +1,16 @@
+{% extends "pages/abstract/error.html.twig" %}
+
+{% block page_title %}{{ translate('ERROR.404.TITLE') }}{% endblock %}
+
+{% block page_description %}{{ translate('ERROR.404.DESCRIPTION') }}{% endblock %}
+
+{% block headline %}404 {% endblock %}
+
+{% block heading %} {{ translate('ERROR.404.DETAIL') }}{% endblock %}
+
+{% block content %}
+
+ {{ translate('ERROR.404.EXPLAIN') }}
+ {{ translate('ERROR.404.RETURN', {url: site.uri.public})|raw }}
+
+{% endblock %}
diff --git a/login/app/sprinkles/core/templates/pages/error/config-errors.html.twig b/login/app/sprinkles/core/templates/pages/error/config-errors.html.twig
new file mode 100755
index 0000000..314b3b8
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/error/config-errors.html.twig
@@ -0,0 +1,22 @@
+{% extends "pages/abstract/error.html.twig" %}
+
+{% block page_title %}{{ translate('ERROR.CONFIG.TITLE') }}{% endblock %}
+
+{% block page_description %}{{ translate('ERROR.CONFIG.DESCRIPTION') }}{% endblock %}
+
+{% block heading %} {{ translate('ERROR.CONFIG.DETAIL') }}{% endblock %}
+
+{% block content %}
+ {{ translate('ERROR.CONFIG.RETURN', {url: "#{site.uri.public}"})|raw }}.
+
+ {% autoescape false %}
+ {% for message in messages %}
+
+
+
{{message.title}}
+
{{message.message | raw}}
+
+
+ {% endfor %}
+ {% endautoescape %}
+{% endblock %}
diff --git a/login/app/sprinkles/core/templates/pages/index.html.twig b/login/app/sprinkles/core/templates/pages/index.html.twig
new file mode 100755
index 0000000..fea1213
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/index.html.twig
@@ -0,0 +1,185 @@
+{% extends "pages/abstract/default.html.twig" %}
+
+{% set page_active = "home" %}
+
+{# Overrides blocks in head of base template #}
+{% block page_title %}{{translate("HOME")}}{% endblock %}
+
+{% block page_description %}{{translate("WELCOME_TO", {'title': site.title})}}{% endblock %}
+
+{% block body_matter %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ First Slide
+
+
+
+
+
+
+ Second Slide
+
+
+
+
+
+
+ Third Slide
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bootstrap v3.2.0
+
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque, optio corporis quae nulla aspernatur in alias at numquam rerum ea excepturi expedita tenetur assumenda voluptatibus eveniet incidunt dicta nostrum quod?
+
Learn More
+
+
+
+
+
+
+
Free & Open Source
+
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque, optio corporis quae nulla aspernatur in alias at numquam rerum ea excepturi expedita tenetur assumenda voluptatibus eveniet incidunt dicta nostrum quod?
+
Learn More
+
+
+
+
+
+
+
Easy to Use
+
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque, optio corporis quae nulla aspernatur in alias at numquam rerum ea excepturi expedita tenetur assumenda voluptatibus eveniet incidunt dicta nostrum quod?
+
Learn More
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The Modern Business template by Start Bootstrap includes:
+
+ Bootstrap v3.2.0
+
+ jQuery v1.11.0
+ Font Awesome v4.1.0
+ Unstyled page elements for easy customization
+ 17 HTML pages
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis, omnis doloremque non cum id reprehenderit, quisquam totam aspernatur tempora minima unde aliquid ea culpa sunt. Reiciendis quia dolorum ducimus unde.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias, expedita, saepe, vero rerum deleniti beatae veniam harum neque nemo praesentium cum alias asperiores commodi.
+
+
+
+
+{% endblock %}
+
+
+
+{% block scripts_page %}
+
+
+{% endblock %}
diff --git a/login/app/sprinkles/core/templates/pages/legal.html.twig b/login/app/sprinkles/core/templates/pages/legal.html.twig
new file mode 100755
index 0000000..c1eac19
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/legal.html.twig
@@ -0,0 +1,12 @@
+{% extends "pages/abstract/default.html.twig" %}
+
+{% set page_active = "home" %}
+
+{# Overrides blocks in head of base template #}
+{% block page_title %}{{translate("LEGAL")}}{% endblock %}
+
+{% block page_description %}{{translate("LEGAL.DESCRIPTION")}}{% endblock %}
+
+{% block body_matter %}
+ {% include 'pages/partials/legal.html.twig' %}
+{% endblock %}
diff --git a/login/app/sprinkles/core/templates/pages/partials/alerts.html.twig b/login/app/sprinkles/core/templates/pages/partials/alerts.html.twig
new file mode 100755
index 0000000..a7f9c08
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/partials/alerts.html.twig
@@ -0,0 +1,13 @@
+{# This contains a client-side Handlebars template.
+ # Note that these are NOT Twig templates, although the syntax is similar. We wrap them in the `verbatim` tag,
+ # so that Twig will output them directly into the DOM instead of trying to treat them like Twig templates.
+ #}
+
+{% verbatim %}
+
+{% endverbatim %}
\ No newline at end of file
diff --git a/login/app/sprinkles/core/templates/pages/partials/analytics.html.twig b/login/app/sprinkles/core/templates/pages/partials/analytics.html.twig
new file mode 100755
index 0000000..3fbeeed
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/partials/analytics.html.twig
@@ -0,0 +1,15 @@
+{% if site.analytics.google.code and site.analytics.google.enabled %}
+
+{% elseif site.debug.info %}
+
+{% endif %}
diff --git a/login/app/sprinkles/core/templates/pages/partials/config.js.twig b/login/app/sprinkles/core/templates/pages/partials/config.js.twig
new file mode 100755
index 0000000..a7a60f0
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/partials/config.js.twig
@@ -0,0 +1,13 @@
+{# Configuration variables needed by client-side code (Javascript). #}
+{% autoescape 'js' %}
+ var site = {
+ "uri": {
+ "public": "{{ site.uri.public | raw }}"
+ },
+ "debug": {
+ "ajax": {{ site.debug.ajax ? 'true' : 'false' }}
+ },
+ "csrf": {{ site.csrf | json_encode(constant('JSON_PRETTY_PRINT')) | raw }},
+ "uf_table": {{ site.uf_table | json_encode(constant('JSON_PRETTY_PRINT')) | raw }}
+ };
+{% endautoescape %}
diff --git a/login/app/sprinkles/core/templates/pages/partials/favicons.html.twig b/login/app/sprinkles/core/templates/pages/partials/favicons.html.twig
new file mode 100755
index 0000000..11b0c52
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/partials/favicons.html.twig
@@ -0,0 +1,39 @@
+{# Favicons generated with https://realfavicongenerator.net #}
+
+{# Basic favicon #}
+
+
+{# PNG versions #}
+
+
+
+{#
+ IE 10 Metro tile icon (Metro equivalent of apple-touch-icon-precomposed)
+ (see https://github.com/audreyr/favicon-cheat-sheet)
+#}
+
+
+
+{# IE 11 Tile for Windows 8.1 Start Screen #}
+
+
+
+
+{# Apple touch icons #}
+
+
+
+
+
+
+
+
+
+
+{# Chrome icons and manifest #}
+
+
+
+
+{# Safari pinned sites icons #}
+
diff --git a/login/app/sprinkles/core/templates/pages/partials/footer.html.twig b/login/app/sprinkles/core/templates/pages/partials/footer.html.twig
new file mode 100755
index 0000000..e7a93c3
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/partials/footer.html.twig
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/login/app/sprinkles/core/templates/pages/partials/legal.html.twig b/login/app/sprinkles/core/templates/pages/partials/legal.html.twig
new file mode 100755
index 0000000..65fe61c
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/partials/legal.html.twig
@@ -0,0 +1,95 @@
+
+
+ Web Site Terms and Conditions of Use
+
+
+
+ 1. Terms
+
+
+
+ By accessing this web site, you are agreeing to be bound by these
+ web site Terms and Conditions of Use, all applicable laws and regulations,
+ and agree that you are responsible for compliance with any applicable local
+ laws. If you do not agree with any of these terms, you are prohibited from
+ using or accessing this site. The materials contained in this web site are
+ protected by applicable copyright and trade mark law.
+
+
+
+ 2. Use License
+
+
+
+
+ Permission is granted to temporarily download one copy of the materials
+ (information or software) on {{site.title}}'s web site for personal,
+ non-commercial transitory viewing only. This is the grant of a license,
+ not a transfer of title, and under this license you may not:
+
+
+ modify or copy the materials;
+ use the materials for any commercial purpose, or for any public display (commercial or non-commercial);
+ attempt to decompile or reverse engineer any software contained on {{site.title}}'s web site;
+ remove any copyright or other proprietary notations from the materials; or
+ transfer the materials to another person or "mirror" the materials on any other server.
+
+
+
+ This license shall automatically terminate if you violate any of these restrictions and may be terminated by {{site.title}} at any time. Upon terminating your viewing of these materials or upon the termination of this license, you must destroy any downloaded materials in your possession whether in electronic or printed format.
+
+
+
+
+ 3. Disclaimer
+
+
+
+
+ The materials on {{site.title}}'s web site are provided "as is". {{site.title}} makes no warranties, expressed or implied, and hereby disclaims and negates all other warranties, including without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights. Further, {{site.title}} does not warrant or make any representations concerning the accuracy, likely results, or reliability of the use of the materials on its Internet web site or otherwise relating to such materials or on any sites linked to this site.
+
+
+
+
+ 4. Limitations
+
+
+
+ In no event shall {{site.title}} or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption,) arising out of the use or inability to use the materials on {{site.title}}'s Internet site, even if {{site.title}} or a {{site.title}} authorized representative has been notified orally or in writing of the possibility of such damage. Because some jurisdictions do not allow limitations on implied warranties, or limitations of liability for consequential or incidental damages, these limitations may not apply to you.
+
+
+
+ 5. Revisions and Errata
+
+
+
+ The materials appearing on {{site.title}}'s web site could include technical, typographical, or photographic errors. {{site.title}} does not warrant that any of the materials on its web site are accurate, complete, or current. {{site.title}} may make changes to the materials contained on its web site at any time without notice. {{site.title}} does not, however, make any commitment to update the materials.
+
+
+
+ 6. Links
+
+
+
+ {{site.title}} has not reviewed all of the sites linked to its Internet web site and is not responsible for the contents of any such linked site. The inclusion of any link does not imply endorsement by {{site.title}} of the site. Use of any such linked web site is at the user's own risk.
+
+
+
+ 7. Site Terms of Use Modifications
+
+
+
+ {{site.title}} may revise these terms of use for its web site at any time without notice. By using this web site you are agreeing to be bound by the then current version of these Terms and Conditions of Use.
+
+
+
+ 8. Governing Law
+
+
+
+ Any claim relating to {{site.title}}'s web site shall be governed by the laws of {{site.site_location}} without regard to its conflict of law provisions.
+
+
+
+ General Terms and Conditions applicable to Use of a Web Site.
+
diff --git a/login/app/sprinkles/core/templates/pages/partials/page.js.twig b/login/app/sprinkles/core/templates/pages/partials/page.js.twig
new file mode 100755
index 0000000..51a1703
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/partials/page.js.twig
@@ -0,0 +1,4 @@
+{# Page variables needed by client-side code (Javascript). #}
+{% autoescape 'js' %}
+ var page = {{ page | json_encode(constant('JSON_PRETTY_PRINT')) | raw }};
+{% endautoescape %}
diff --git a/login/app/sprinkles/core/templates/pages/partials/privacy.html.twig b/login/app/sprinkles/core/templates/pages/partials/privacy.html.twig
new file mode 100755
index 0000000..6a6cafc
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/partials/privacy.html.twig
@@ -0,0 +1,35 @@
+
+ Privacy Policy
+
+
+
+ Your privacy is very important to us. Accordingly, we have developed this Policy in order for you to understand how we collect, use, communicate and disclose and make use of personal information. The following outlines our privacy policy.
+
+
+
+
+ Before or at the time of collecting personal information, we will identify the purposes for which information is being collected.
+
+
+ We will collect and use of personal information solely with the objective of fulfilling those purposes specified by us and for other compatible purposes, unless we obtain the consent of the individual concerned or as required by law.
+
+
+ We will only retain personal information as long as necessary for the fulfillment of those purposes.
+
+
+ We will collect personal information by lawful and fair means and, where appropriate, with the knowledge or consent of the individual concerned.
+
+
+ Personal data should be relevant to the purposes for which it is to be used, and, to the extent necessary for those purposes, should be accurate, complete, and up-to-date.
+
+
+ We will protect personal information by reasonable security safeguards against loss or theft, as well as unauthorized access, disclosure, copying, use or modification.
+
+
+ We will make readily available to customers information about our policies and practices relating to the management of personal information.
+
+
+
+
+ We are committed to conducting our business in accordance with these principles in order to ensure that the confidentiality of personal information is protected and maintained.
+
diff --git a/login/app/sprinkles/core/templates/pages/privacy.html.twig b/login/app/sprinkles/core/templates/pages/privacy.html.twig
new file mode 100755
index 0000000..75db423
--- /dev/null
+++ b/login/app/sprinkles/core/templates/pages/privacy.html.twig
@@ -0,0 +1,12 @@
+{% extends "pages/abstract/default.html.twig" %}
+
+{% set page_active = "home" %}
+
+{# Overrides blocks in head of base template #}
+{% block page_title %}{{translate("PRIVACY")}}{% endblock %}
+
+{% block page_description %}{{translate("PRIVACY.DESCRIPTION")}}{% endblock %}
+
+{% block body_matter %}
+ {% include 'pages/partials/privacy.html.twig' %}
+{% endblock %}
diff --git a/login/app/sprinkles/core/templates/tables/table-paginated.html.twig b/login/app/sprinkles/core/templates/tables/table-paginated.html.twig
new file mode 100755
index 0000000..5b94120
--- /dev/null
+++ b/login/app/sprinkles/core/templates/tables/table-paginated.html.twig
@@ -0,0 +1,59 @@
+{# Base layout for paginated tablesorter tables.
+ # Requires tablesorter-custom.css for proper styling of pager elements.
+#}
+
+{# Set some default values for the child template. #}
+{% set table = {
+ 'id': "uf-table",
+ 'sortlist': "[[0, 0]]"
+ } | merge(table)
+%}
+
+{#
+ Global search field for the table. By default, only shown in mobile sizes.
+ To customize this behavior, see core/assets/userfrosting/css/userfrosting.css
+#}
+{% block table_search %}
+
+
+
+
+{% endblock %}
+
+ {% block table %}
+ {# Define your table skeleton in this block in your child template #}
+ {% endblock %}
+
+ {% block table_cell_templates %}
+ {# Define your Handlebars cell templates in this block in your child template #}
+ {% endblock %}
+
+ {% block table_info %}
+
+
+ {% endblock %}
+
+ {% block table_pager_controls %}
+
+ {% endblock %}
+ {% block table_overlay %}
+ {% if site.uf_table.use_loading_transition %}
+
+
+
+ {% endif %}
+ {% endblock %}
+
diff --git a/login/app/sprinkles/core/templates/tables/table-tool-menu.html.twig b/login/app/sprinkles/core/templates/tables/table-tool-menu.html.twig
new file mode 100755
index 0000000..0c4dfed
--- /dev/null
+++ b/login/app/sprinkles/core/templates/tables/table-tool-menu.html.twig
@@ -0,0 +1,25 @@
+{# Tool menu for table panels #}
+
+
diff --git a/login/app/sprinkles/core/tests/Integration/DatabaseTests.php b/login/app/sprinkles/core/tests/Integration/DatabaseTests.php
new file mode 100755
index 0000000..231bb86
--- /dev/null
+++ b/login/app/sprinkles/core/tests/Integration/DatabaseTests.php
@@ -0,0 +1,1315 @@
+ci->db;
+
+ $this->createSchema();
+ }
+
+ protected function createSchema()
+ {
+ $this->schema($this->schemaName)->create('users', function ($table) {
+ $table->increments('id');
+ $table->string('name')->nullable();
+ });
+
+ // Users have multiple email addresses
+ $this->schema($this->schemaName)->create('emails', function ($table) {
+ $table->increments('id');
+ $table->integer('user_id');
+ $table->string('label');
+ $table->string('email');
+ });
+
+ // Users have multiple phones (polymorphic - other entities can have phones as well)
+ $this->schema($this->schemaName)->create('phones', function ($table) {
+ $table->increments('id');
+ $table->string('label');
+ $table->string('number', 20);
+ $table->morphs('phoneable');
+ });
+
+ // Users have multiple roles... (m:m)
+ $this->schema($this->schemaName)->create('role_users', function ($table) {
+ $table->integer('user_id')->unsigned();
+ $table->integer('role_id')->unsigned();
+ });
+
+ $this->schema($this->schemaName)->create('roles', function ($table) {
+ $table->increments('id');
+ $table->string('slug');
+ });
+
+ // And Roles have multiple permissions... (m:m)
+ $this->schema($this->schemaName)->create('permission_roles', function ($table) {
+ $table->integer('permission_id')->unsigned();
+ $table->integer('role_id')->unsigned();
+ });
+
+ $this->schema($this->schemaName)->create('permissions', function($table) {
+ $table->increments('id');
+ $table->string('slug');
+ });
+
+ // A user can be assigned to a specific task at a specific location
+ $this->schema($this->schemaName)->create('tasks', function($table) {
+ $table->increments('id');
+ $table->string('name');
+ });
+
+ $this->schema($this->schemaName)->create('locations', function($table) {
+ $table->increments('id');
+ $table->string('name');
+ });
+
+ $this->schema($this->schemaName)->create('assignments', function($table) {
+ $table->integer('task_id')->unsigned();
+ $table->integer('location_id')->unsigned();
+ $table->morphs('assignable');
+ });
+
+ $this->schema($this->schemaName)->create('jobs', function($table) {
+ $table->integer('user_id')->unsigned();
+ $table->integer('location_id')->unsigned();
+ $table->integer('role_id')->unsigned();
+ $table->string('title');
+ });
+ }
+
+ /**
+ * Tear down the database schema.
+ *
+ * @return void
+ */
+ public function tearDown()
+ {
+ $this->schema($this->schemaName)->drop('users');
+ $this->schema($this->schemaName)->drop('emails');
+ $this->schema($this->schemaName)->drop('phones');
+ $this->schema($this->schemaName)->drop('role_users');
+ $this->schema($this->schemaName)->drop('roles');
+ $this->schema($this->schemaName)->drop('permission_roles');
+ $this->schema($this->schemaName)->drop('permissions');
+ $this->schema($this->schemaName)->drop('tasks');
+ $this->schema($this->schemaName)->drop('locations');
+ $this->schema($this->schemaName)->drop('assignments');
+
+ Relation::morphMap([], false);
+ }
+
+ /**
+ * Tests...
+ */
+ public function testOneToManyRelationship()
+ {
+ $user = EloquentTestUser::create(['name' => 'David']);
+ $user->emails()->create([
+ 'label' => 'primary',
+ 'email' => 'david@owlfancy.com'
+ ]);
+ $user->emails()->create([
+ 'label' => 'work',
+ 'email' => 'david@attenboroughsreef.com'
+ ]);
+
+ $emails = $user->emails;
+
+ $this->assertInstanceOf('Illuminate\Database\Eloquent\Collection', $emails);
+ $this->assertEquals(2, $emails->count());
+ $this->assertInstanceOf('UserFrosting\Tests\Integration\EloquentTestEmail', $emails[0]);
+ $this->assertInstanceOf('UserFrosting\Tests\Integration\EloquentTestEmail', $emails[1]);
+ }
+
+ /**
+ * Tests our custom HasManySyncable class.
+ */
+ public function testSyncOneToMany()
+ {
+ $user = EloquentTestUser::create(['name' => 'David']);
+ // Set up original emails
+ $user->emails()->create([
+ 'id' => 1,
+ 'label' => 'primary',
+ 'email' => 'david@owlfancy.com'
+ ]);
+ $user->emails()->create([
+ 'id' => 2,
+ 'label' => 'work',
+ 'email' => 'david@attenboroughsreef.com'
+ ]);
+
+ // Delete `work`, update `primary`, and add `gmail`
+ $user->emails()->sync([
+ [
+ 'id' => 1,
+ 'email' => 'david@aol.com'
+ ],
+ [
+ 'label' => 'gmail',
+ 'email' => 'davidattenborough@gmail.com'
+ ]
+ ]);
+
+ $emails = $user->emails->toArray();
+
+ $this->assertEquals([
+ [
+ 'id' => 1,
+ 'user_id'=> 1,
+ 'label' => 'primary',
+ 'email' => 'david@aol.com'
+ ],
+ [
+ 'id' => 3,
+ 'user_id' => 1,
+ 'label' => 'gmail',
+ 'email' => 'davidattenborough@gmail.com'
+ ]
+ ], $emails);
+ }
+
+ /**
+ * Tests our custom MorphManySyncable class.
+ */
+ public function testSyncMorphMany()
+ {
+ $user = EloquentTestUser::create(['name' => 'David']);
+ // Set up original phones
+ $user->phones()->create([
+ 'id' => 1,
+ 'label' => 'primary',
+ 'number' => '5555551212'
+ ]);
+ $user->phones()->create([
+ 'id' => 2,
+ 'label' => 'work',
+ 'number' => '2223334444'
+ ]);
+
+ // Delete `work`, update `primary`, and add `fax`
+ $user->phones()->sync([
+ [
+ 'id' => 1,
+ 'number' => '8883332222'
+ ],
+ [
+ 'label' => 'fax',
+ 'number' => '5550005555'
+ ]
+ ]);
+
+ $phones = $user->phones->toArray();
+
+ $this->assertEquals([
+ [
+ 'id' => 1,
+ 'phoneable_id'=> 1,
+ 'phoneable_type' => 'UserFrosting\Tests\Integration\EloquentTestUser',
+ 'label' => 'primary',
+ 'number' => '8883332222'
+ ],
+ [
+ 'id' => 3,
+ 'phoneable_id'=> 1,
+ 'phoneable_type' => 'UserFrosting\Tests\Integration\EloquentTestUser',
+ 'label' => 'fax',
+ 'number' => '5550005555'
+ ]
+ ], $phones);
+ }
+
+ public function testBelongsToManyUnique()
+ {
+ $user = EloquentTestUser::create(['name' => 'David']);
+
+ $this->generateLocations();
+ $this->generateRoles();
+ $this->generateJobs();
+
+ $expectedRoles = [
+ [
+ 'id' => 2,
+ 'slug' => 'soldier',
+ 'pivot' => [
+ 'user_id' => 1,
+ 'role_id' => 2
+ ]
+ ],
+ [
+ 'id' => 3,
+ 'slug' => 'egg-layer',
+ 'pivot' => [
+ 'user_id' => 1,
+ 'role_id' => 3
+ ]
+ ]
+ ];
+
+ $roles = $user->jobRoles;
+ $this->assertEquals($expectedRoles, $roles->toArray());
+
+ // Test eager loading
+ $users = EloquentTestUser::with('jobRoles')->get();
+ $this->assertEquals($expectedRoles, $users->toArray()[0]['job_roles']);
+ }
+
+ public function testMorphsToManyUnique()
+ {
+ $user = EloquentTestUser::create(['name' => 'David']);
+ $user2 = EloquentTestUser::create(['name' => 'Alex']);
+
+ $this->generateTasks();
+ $this->generateLocations();
+ $this->generateAssignments();
+
+ $expectedTasks = [
+ [
+ 'id' => 2,
+ 'name' => 'Chopping',
+ 'pivot' => [
+ 'assignable_id' => 1,
+ 'task_id' => 2
+ ]
+ ],
+ [
+ 'id' => 3,
+ 'name' => 'Baleing',
+ 'pivot' => [
+ 'assignable_id' => 1,
+ 'task_id' => 3
+ ]
+ ]
+ ];
+
+ $tasks = $user->assignmentTasks;
+ $this->assertEquals($expectedTasks, $tasks->toArray());
+
+ // Test eager loading
+ $users = EloquentTestUser::with('assignmentTasks')->get();
+ $this->assertEquals($expectedTasks, $users->toArray()[0]['assignment_tasks']);
+ }
+
+ public function testMorphsToManyUniqueWithTertiary()
+ {
+ $user = EloquentTestUser::create(['name' => 'David']);
+ $user2 = EloquentTestUser::create(['name' => 'Alex']);
+
+ $this->generateTasks();
+ $this->generateLocations();
+ $this->generateAssignments();
+
+ $expectedTasks = [
+ [
+ 'id' => 2,
+ 'name' => 'Chopping',
+ 'pivot' => [
+ 'assignable_id' => 1,
+ 'task_id' => 2
+ ],
+ 'locations' => [
+ [
+ 'id' => 1,
+ 'name' => 'Hatchery',
+ 'pivot' => [
+ 'location_id' => 1,
+ 'task_id' => 2
+ ],
+ ],
+ [
+ 'id' => 2,
+ 'name' => 'Nexus',
+ 'pivot' => [
+ 'location_id' => 2,
+ 'task_id' => 2
+ ],
+ ]
+ ]
+ ],
+ [
+ 'id' => 3,
+ 'name' => 'Baleing',
+ 'pivot' => [
+ 'assignable_id' => 1,
+ 'task_id' => 3
+ ],
+ 'locations' => [
+ [
+ 'id' => 2,
+ 'name' => 'Nexus',
+ 'pivot' => [
+ 'location_id' => 2,
+ 'task_id' => 3
+ ],
+ ]
+ ]
+ ]
+ ];
+
+ $tasks = $user->tasks;
+ $this->assertEquals($expectedTasks, $tasks->toArray());
+
+ // Test eager loading
+ $users = EloquentTestUser::with('tasks')->get();
+ $this->assertEquals($expectedTasks, $users->toArray()[0]['tasks']);
+ }
+
+ public function testBelongsToManyUniqueWithTertiary()
+ {
+ $user = EloquentTestUser::create(['name' => 'David']);
+
+ $this->generateLocations();
+ $this->generateRoles();
+ $this->generateJobs();
+
+ $expectedJobs = [
+ [
+ 'id' => 2,
+ 'slug' => 'soldier',
+ 'pivot' => [
+ 'user_id' => 1,
+ 'role_id' => 2
+ ],
+ 'locations' => [
+ [
+ 'id' => 1,
+ 'name' => 'Hatchery',
+ 'pivot' => [
+ 'title' => 'Grunt',
+ 'location_id' => 1,
+ 'role_id' => 2
+ ]
+ ],
+ [
+ 'id' => 2,
+ 'name' => 'Nexus',
+ 'pivot' => [
+ 'title' => 'Sergeant',
+ 'location_id' => 2,
+ 'role_id' => 2
+ ]
+ ]
+ ]
+ ],
+ [
+ 'id' => 3,
+ 'slug' => 'egg-layer',
+ 'pivot' => [
+ 'user_id' => 1,
+ 'role_id' => 3
+ ],
+ 'locations' => [
+ [
+ 'id' => 2,
+ 'name' => 'Nexus',
+ 'pivot' => [
+ 'title' => 'Queen',
+ 'location_id' => 2,
+ 'role_id' => 3
+ ]
+ ]
+ ]
+ ]
+ ];
+
+ $jobs = $user->jobs()->withPivot('title')->get();
+ $this->assertEquals($expectedJobs, $jobs->toArray());
+
+ // Test eager loading
+ $users = EloquentTestUser::with(['jobs' => function ($relation) {
+ return $relation->withPivot('title');
+ }])->get();
+
+ $this->assertEquals($expectedJobs, $users->toArray()[0]['jobs']);
+ }
+
+ public function testBelongsToManyUniqueWithTertiaryEagerLoad()
+ {
+ $user1 = EloquentTestUser::create(['name' => 'David']);
+ $user2 = EloquentTestUser::create(['name' => 'Alex']);
+
+ $this->generateLocations();
+ $this->generateRoles();
+ $this->generateJobs();
+
+ $users = EloquentTestUser::with('jobs')->get();
+
+ $this->assertEquals([
+ [
+ 'id' => 1,
+ 'name' => 'David',
+ 'jobs' => [
+ [
+ 'id' => 2,
+ 'slug' => 'soldier',
+ 'pivot' => [
+ 'user_id' => 1,
+ 'role_id' => 2
+ ],
+ 'locations' => [
+ [
+ 'id' => 1,
+ 'name' => 'Hatchery',
+ 'pivot' => [
+ 'location_id' => 1,
+ 'role_id' => 2
+ ]
+ ],
+ [
+ 'id' => 2,
+ 'name' => 'Nexus',
+ 'pivot' => [
+ 'location_id' => 2,
+ 'role_id' => 2
+ ]
+ ]
+ ]
+ ],
+ [
+ 'id' => 3,
+ 'slug' => 'egg-layer',
+ 'pivot' => [
+ 'user_id' => 1,
+ 'role_id' => 3
+ ],
+ 'locations' => [
+ [
+ 'id' => 2,
+ 'name' => 'Nexus',
+ 'pivot' => [
+ 'location_id' => 2,
+ 'role_id' => 3
+ ]
+ ]
+ ]
+ ]
+ ]
+ ],
+ [
+ 'id' => 2,
+ 'name' => 'Alex',
+ 'jobs' => [
+ [
+ 'id' => 3,
+ 'slug' => 'egg-layer',
+ 'pivot' => [
+ 'user_id' => 2,
+ 'role_id' => 3
+ ],
+ 'locations' => [
+ [
+ 'id' => 1,
+ 'name' => 'Hatchery',
+ 'pivot' => [
+ 'location_id' => 1,
+ 'role_id' => 3
+ ]
+ ],
+ ]
+ ]
+ ]
+ ]
+ ], $users->toArray());
+ }
+
+ /**
+ * Test the ability of a BelongsToManyThrough relationship to retrieve structured data on a single model or set of models.
+ */
+ public function testBelongsToManyThrough()
+ {
+ $this->generateRolesWithPermissions();
+
+ $user = EloquentTestUser::create(['name' => 'David']);
+
+ $user->roles()->attach([1,2]);
+
+ // Test retrieval of via models as well
+ $this->assertEquals([
+ [
+ 'id' => 1,
+ 'slug' => 'uri_harvest',
+ 'pivot' => [
+ 'user_id' => 1,
+ 'permission_id' => 1
+ ]
+ ],
+ [
+ 'id' => 2,
+ 'slug' => 'uri_spit_acid',
+ 'pivot' => [
+ 'user_id' => 1,
+ 'permission_id' => 2
+ ]
+ ],
+ [
+ 'id' => 3,
+ 'slug' => 'uri_slash',
+ 'pivot' => [
+ 'user_id' => 1,
+ 'permission_id' => 3
+ ]
+ ]
+ ], $user->permissions->toArray());
+
+ // Test counting
+ $this->assertEquals(3, $user->permissions()->count());
+
+ $user2 = EloquentTestUser::create(['name' => 'Alex']);
+ $user2->roles()->attach([2,3]);
+
+ // Test eager load
+ $users = EloquentTestUser::with('permissions')->get();
+ $usersWithPermissions = $users->toArray();
+
+ $this->assertEquals([
+ [
+ 'id' => 2,
+ 'slug' => 'uri_spit_acid',
+ 'pivot' => [
+ 'user_id' => 2,
+ 'permission_id' => 2
+ ]
+ ],
+ [
+ 'id' => 3,
+ 'slug' => 'uri_slash',
+ 'pivot' => [
+ 'user_id' => 2,
+ 'permission_id' => 3
+ ]
+ ],
+ [
+ 'id' => 4,
+ 'slug' => 'uri_royal_jelly',
+ 'pivot' => [
+ 'user_id' => 2,
+ 'permission_id' => 4
+ ]
+ ]
+ ],$usersWithPermissions[1]['permissions']);
+
+ // Test counting related models (withCount)
+ $users = EloquentTestUser::withCount('permissions')->get();
+ $this->assertEquals(3, $users[0]->permissions_count);
+ $this->assertEquals(3, $users[1]->permissions_count);
+
+ $this->assertInstanceOf(EloquentTestPermission::class, $users[0]->permissions[0]);
+ $this->assertInstanceOf(EloquentTestPermission::class, $users[0]->permissions[1]);
+ $this->assertInstanceOf(EloquentTestPermission::class, $users[0]->permissions[2]);
+ }
+
+ /**
+ * Test the ability of a BelongsToManyThrough relationship to retrieve and count paginated queries.
+ */
+ public function testBelongsToManyThroughPaginated()
+ {
+ $this->generateRolesWithPermissions();
+
+ $user = EloquentTestUser::create(['name' => 'David']);
+
+ $user->roles()->attach([1,2]);
+
+ $paginatedPermissions = $user->permissions()->take(2)->offset(1);
+
+ $this->assertEquals([
+ [
+ 'id' => 2,
+ 'slug' => 'uri_spit_acid',
+ 'pivot' => [
+ 'user_id' => 1,
+ 'permission_id' => 2
+ ]
+ ],
+ [
+ 'id' => 3,
+ 'slug' => 'uri_slash',
+ 'pivot' => [
+ 'user_id' => 1,
+ 'permission_id' => 3
+ ]
+ ]
+ ], $paginatedPermissions->get()->toArray());
+
+ $this->assertEquals(2, $paginatedPermissions->count());
+ }
+
+ /**
+ * Test the ability of a BelongsToManyThrough relationship to retrieve structured data on a single model or set of models,
+ * eager loading the "via" models at the same time.
+ */
+ public function testBelongsToManyThroughWithVia()
+ {
+ $this->generateRolesWithPermissions();
+
+ $user = EloquentTestUser::create(['name' => 'David']);
+
+ $user->roles()->attach([1,2]);
+
+ // Test retrieval of via models as well
+ $this->assertBelongsToManyThroughForDavid($user->permissions()->withVia('roles_via')->get()->toArray());
+
+ $user2 = EloquentTestUser::create(['name' => 'Alex']);
+ $user2->roles()->attach([2,3]);
+
+ // Test eager loading
+ $users = EloquentTestUser::with(['permissions' => function ($query) {
+ return $query->withVia('roles_via');
+ }])->get();
+
+ $this->assertInstanceOf(EloquentTestPermission::class, $users[0]->permissions[0]);
+ $this->assertInstanceOf(EloquentTestRole::class, $users[0]->permissions[0]->roles_via[0]);
+
+ $usersWithPermissions = $users->toArray();
+
+ $this->assertBelongsToManyThroughForDavid($usersWithPermissions[0]['permissions']);
+ $this->assertBelongsToManyThroughForAlex($usersWithPermissions[1]['permissions']);
+ }
+
+ public function testQueryExclude()
+ {
+ $this->generateRoles();
+ $this->generateJobs();
+ $job = EloquentTestJob::exclude('location_id', 'title')->first();
+
+ $this->assertEquals([
+ 'role_id' => 2,
+ 'user_id' => 1
+ ], $job->toArray());
+ }
+
+
+ public function testQueryExcludeOnJoinedTable()
+ {
+ $this->generateRolesWithPermissions();
+
+ $user = EloquentTestUser::create(['name' => 'David']);
+
+ $user->roles()->attach([1,2]);
+
+ $users = EloquentTestUser::with(['permissions' => function ($query) {
+ $query->exclude('slug');
+ }])->get();
+
+ $this->assertEquals([
+ [
+ 'id' => 1,
+ 'name' => 'David',
+ 'permissions' => [
+ [
+ 'id' => 1,
+ 'pivot' => [
+ 'user_id' => 1,
+ 'permission_id' => 1
+ ]
+ ],
+ [
+ 'id' => 2,
+ 'pivot' => [
+ 'user_id' => 1,
+ 'permission_id' => 2
+ ]
+ ],
+ [
+ 'id' => 3,
+ 'pivot' => [
+ 'user_id' => 1,
+ 'permission_id' => 3
+ ]
+ ]
+ ]
+ ]
+ ], $users->toArray());
+ }
+
+ public function testQueryExcludeUseQualifiedNamesOnJoinedTable()
+ {
+ $this->generateRolesWithPermissions();
+
+ $user = EloquentTestUser::create(['name' => 'David']);
+
+ $user->roles()->attach([1,2]);
+
+ $users = EloquentTestUser::with(['roles' => function ($query) {
+ $query->addSelect('roles.*', 'jobs.*')->leftJoin('jobs', 'jobs.role_id', '=', 'roles.id')
+ ->exclude('slug', 'jobs.user_id', 'jobs.location_id', 'jobs.role_id');
+ }])->get();
+
+ $this->assertEquals([
+ [
+ 'id' => 1,
+ 'name' => 'David',
+ 'roles' => [
+ [
+ 'id' => 1,
+ 'title' => null,
+ 'pivot' => [
+ 'user_id' => 1,
+ 'role_id' => 1
+ ]
+ ],
+ [
+ 'id' => 2,
+ 'title' => null,
+ 'pivot' => [
+ 'user_id' => 1,
+ 'role_id' => 2
+ ]
+ ]
+ ]
+ ]
+ ], $users->toArray());
+ }
+
+ public function testQueryExcludeWildcard()
+ {
+ $this->generateRoles();
+ $this->generateJobs();
+ $job = EloquentTestJob::select('*')->addSelect('user_id')->exclude('*')->first();
+
+ $this->assertEquals([
+ 'user_id' => 1
+ ], $job->toArray());
+
+ $job = EloquentTestJob::select('jobs.*')->addSelect('user_id')->exclude('*')->first();
+
+ $this->assertEquals([
+ 'user_id' => 1
+ ], $job->toArray());
+
+ $job = EloquentTestJob::select('*')->addSelect('user_id')->exclude('jobs.*')->first();
+
+ $this->assertEquals([
+ 'user_id' => 1
+ ], $job->toArray());
+ }
+
+ /**
+ * Helpers...
+ */
+
+ /**
+ * Get a database connection instance.
+ *
+ * @return \Illuminate\Database\Connection
+ */
+ protected function connection($connection = 'test_integration')
+ {
+ return Model::getConnectionResolver()->connection($connection);
+ }
+
+ /**
+ * Get a schema builder instance.
+ *
+ * @return \Illuminate\Database\Schema\Builder
+ */
+ protected function schema($connection = 'test_integration')
+ {
+ return $this->connection($connection)->getSchemaBuilder();
+ }
+
+ protected function generateRoles()
+ {
+ return [
+ EloquentTestRole::create([
+ 'id' => 1,
+ 'slug' => 'forager'
+ ]),
+
+ EloquentTestRole::create([
+ 'id' => 2,
+ 'slug' => 'soldier'
+ ]),
+
+ EloquentTestRole::create([
+ 'id' => 3,
+ 'slug' => 'egg-layer'
+ ])
+ ];
+ }
+
+ protected function generatePermissions()
+ {
+ return [
+ EloquentTestPermission::create([
+ 'id' => 1,
+ 'slug' => 'uri_harvest'
+ ]),
+
+ EloquentTestPermission::create([
+ 'id' => 2,
+ 'slug' => 'uri_spit_acid'
+ ]),
+
+ EloquentTestPermission::create([
+ 'id' => 3,
+ 'slug' => 'uri_slash'
+ ]),
+
+ EloquentTestPermission::create([
+ 'id' => 4,
+ 'slug' => 'uri_royal_jelly'
+ ])
+ ];
+ }
+
+ protected function generateRolesWithPermissions()
+ {
+ $roles = $this->generateRoles();
+
+ $this->generatePermissions();
+
+ $roles[0]->permissions()->attach([1,2]);
+ // We purposefully want a permission that belongs to more than one role
+ $roles[1]->permissions()->attach([2,3]);
+ $roles[2]->permissions()->attach([2,4]);
+
+ return $roles;
+ }
+
+ protected function generateJobs()
+ {
+
+ /**
+ * Sample data
+
+ | user_id | role_id | location_id |
+ |---------|---------|-------------|
+ | 1 | 2 | 1 |
+ | 1 | 2 | 2 |
+ | 1 | 3 | 2 |
+ | 2 | 3 | 1 |
+ */
+
+ return [
+ EloquentTestJob::create([
+ 'role_id' => 2,
+ 'location_id' => 1,
+ 'user_id' => 1,
+ 'title' => 'Grunt'
+ ]),
+ EloquentTestJob::create([
+ 'role_id' => 2,
+ 'location_id' => 2,
+ 'user_id' => 1,
+ 'title' => 'Sergeant'
+ ]),
+ EloquentTestJob::create([
+ 'role_id' => 3,
+ 'location_id' => 2,
+ 'user_id' => 1,
+ 'title' => 'Queen'
+ ]),
+ EloquentTestJob::create([
+ 'role_id' => 3,
+ 'location_id' => 1,
+ 'user_id' => 2,
+ 'title' => 'Demi-queen'
+ ])
+ ];
+ }
+
+ protected function generateLocations()
+ {
+ return [
+ EloquentTestLocation::create([
+ 'id' => 1,
+ 'name' => 'Hatchery'
+ ]),
+
+ EloquentTestLocation::create([
+ 'id' => 2,
+ 'name' => 'Nexus'
+ ])
+ ];
+ }
+
+ protected function generateTasks()
+ {
+ return [
+ EloquentTestTask::create([
+ 'id' => 1,
+ 'name' => 'Digging'
+ ]),
+
+ EloquentTestTask::create([
+ 'id' => 2,
+ 'name' => 'Chopping'
+ ]),
+
+ EloquentTestTask::create([
+ 'id' => 3,
+ 'name' => 'Baleing'
+ ])
+ ];
+ }
+
+ protected function generateAssignments()
+ {
+ return [
+ EloquentTestAssignment::create([
+ 'task_id' => 2,
+ 'location_id' => 1,
+ 'assignable_id' => 1,
+ 'assignable_type' => 'UserFrosting\Tests\Integration\EloquentTestUser'
+ ]),
+ EloquentTestAssignment::create([
+ 'task_id' => 2,
+ 'location_id' => 2,
+ 'assignable_id' => 1,
+ 'assignable_type' => 'UserFrosting\Tests\Integration\EloquentTestUser'
+ ]),
+ EloquentTestAssignment::create([
+ 'task_id' => 3,
+ 'location_id' => 2,
+ 'assignable_id' => 1,
+ 'assignable_type' => 'UserFrosting\Tests\Integration\EloquentTestUser'
+ ]),
+ EloquentTestAssignment::create([
+ 'task_id' => 3,
+ 'location_id' => 3,
+ 'assignable_id' => 1,
+ 'assignable_type' => 'UserFrosting\Tests\Integration\EloquentTestNonExistant'
+ ]),
+ EloquentTestAssignment::create([
+ 'task_id' => 3,
+ 'location_id' => 1,
+ 'assignable_id' => 2,
+ 'assignable_type' => 'UserFrosting\Tests\Integration\EloquentTestUser'
+ ])
+ ];
+ }
+
+ protected function assertBelongsToManyThroughForDavid($permissions)
+ {
+ // User should have effective permissions uri_harvest, uri_spit_acid, and uri_slash.
+ // We also check that the 'roles_via' relationship is properly set.
+ $this->assertEquals('uri_harvest', $permissions[0]['slug']);
+ $this->assertEquals([
+ [
+ 'id' => 1,
+ 'slug' => 'forager',
+ 'pivot' => [
+ 'permission_id' => 1,
+ 'role_id' => 1
+ ]
+ ]
+ ], $permissions[0]['roles_via']);
+ $this->assertEquals('uri_spit_acid', $permissions[1]['slug']);
+ $this->assertEquals([
+ [
+ 'id' => 1,
+ 'slug' => 'forager',
+ 'pivot' => [
+ 'permission_id' => 2,
+ 'role_id' => 1
+ ]
+ ],
+ [
+ 'id' => 2,
+ 'slug' => 'soldier',
+ 'pivot' => [
+ 'permission_id' => 2,
+ 'role_id' => 2
+ ]
+ ]
+ ], $permissions[1]['roles_via']);
+ $this->assertEquals('uri_slash', $permissions[2]['slug']);
+ $this->assertEquals([
+ [
+ 'id' => 2,
+ 'slug' => 'soldier',
+ 'pivot' => [
+ 'permission_id' => 3,
+ 'role_id' => 2
+ ]
+ ]
+ ], $permissions[2]['roles_via']);
+ }
+
+ protected function assertBelongsToManyThroughForAlex($permissions)
+ {
+ // User should have effective permissions uri_spit_acid, uri_slash, and uri_royal_jelly.
+ // We also check that the 'roles_via' relationship is properly set.
+ $this->assertEquals('uri_spit_acid', $permissions[0]['slug']);
+ $this->assertEquals([
+ [
+ 'id' => 2,
+ 'slug' => 'soldier',
+ 'pivot' => [
+ 'permission_id' => 2,
+ 'role_id' => 2
+ ]
+ ],
+ [
+ 'id' => 3,
+ 'slug' => 'egg-layer',
+ 'pivot' => [
+ 'permission_id' => 2,
+ 'role_id' => 3
+ ]
+ ]
+ ], $permissions[0]['roles_via']);
+ $this->assertEquals('uri_slash', $permissions[1]['slug']);
+ $this->assertEquals([
+ [
+ 'id' => 2,
+ 'slug' => 'soldier',
+ 'pivot' => [
+ 'permission_id' => 3,
+ 'role_id' => 2
+ ]
+ ]
+ ], $permissions[1]['roles_via']);
+ $this->assertEquals('uri_royal_jelly', $permissions[2]['slug']);
+ $this->assertEquals([
+ [
+ 'id' => 3,
+ 'slug' => 'egg-layer',
+ 'pivot' => [
+ 'permission_id' => 4,
+ 'role_id' => 3
+ ]
+ ]
+ ], $permissions[2]['roles_via']);
+ }
+}
+
+/**
+ * Eloquent Models...
+ */
+class EloquentTestModel extends Model
+{
+ protected $connection = 'test_integration';
+}
+
+class EloquentTestUser extends EloquentTestModel
+{
+ protected $table = 'users';
+ protected $guarded = [];
+
+ public function emails()
+ {
+ return $this->hasMany('UserFrosting\Tests\Integration\EloquentTestEmail', 'user_id');
+ }
+
+ public function phones()
+ {
+ return $this->morphMany('UserFrosting\Tests\Integration\EloquentTestPhone', 'phoneable');
+ }
+
+ /**
+ * Get all roles to which this user belongs.
+ *
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
+ */
+ public function roles()
+ {
+ return $this->belongsToMany('UserFrosting\Tests\Integration\EloquentTestRole', 'role_users', 'user_id', 'role_id');
+ }
+
+ /**
+ * Get all of the permissions this user has, via its roles.
+ *
+ * @return \UserFrosting\Sprinkle\Core\Database\Relations\BelongsToManyThrough
+ */
+ public function permissions()
+ {
+ return $this->belongsToManyThrough(
+ 'UserFrosting\Tests\Integration\EloquentTestPermission',
+ 'UserFrosting\Tests\Integration\EloquentTestRole',
+ 'role_users',
+ 'user_id',
+ 'role_id',
+ 'permission_roles',
+ 'role_id',
+ 'permission_id'
+ );
+ }
+
+ /**
+ * Get all of the user's unique tasks.
+ */
+ public function assignmentTasks()
+ {
+ $relation = $this->morphToManyUnique(
+ 'UserFrosting\Tests\Integration\EloquentTestTask',
+ 'assignable',
+ 'assignments',
+ null,
+ 'task_id' // Need to explicitly set this, since it doesn't match our related model name
+ );
+
+ return $relation;
+ }
+
+ /**
+ * Get all of the user's unique tasks along with the task locations.
+ */
+ public function tasks()
+ {
+ $relation = $this->morphToManyUnique(
+ 'UserFrosting\Tests\Integration\EloquentTestTask',
+ 'assignable',
+ 'assignments',
+ null,
+ 'task_id' // Need to explicitly set this, since it doesn't match our related model name
+ )->withTertiary(EloquentTestLocation::class, null, 'location_id');
+
+ return $relation;
+ }
+
+ /**
+ * Get all of the user's unique roles based on their jobs.
+ */
+ public function jobRoles()
+ {
+ $relation = $this->belongsToManyUnique(
+ 'UserFrosting\Tests\Integration\EloquentTestRole',
+ 'jobs',
+ 'user_id',
+ 'role_id'
+ );
+
+ return $relation;
+ }
+
+ /**
+ * Get all of the user's unique roles based on their jobs as a tertiary relationship.
+ */
+ public function jobs()
+ {
+ $relation = $this->belongsToManyUnique(
+ EloquentTestRole::class,
+ 'jobs',
+ 'user_id',
+ 'role_id'
+ )->withTertiary(EloquentTestLocation::class, null, 'location_id');
+
+ return $relation;
+ }
+}
+
+class EloquentTestEmail extends EloquentTestModel
+{
+ protected $table = 'emails';
+ protected $guarded = [];
+
+ public function user()
+ {
+ return $this->belongsTo('UserFrosting\Tests\Integration\EloquentTestUser', 'user_id');
+ }
+}
+
+class EloquentTestPhone extends EloquentTestModel
+{
+ protected $table = 'phones';
+ protected $guarded = [];
+
+ public function phoneable()
+ {
+ return $this->morphTo();
+ }
+}
+
+class EloquentTestRole extends EloquentTestModel
+{
+ protected $table = 'roles';
+ protected $guarded = [];
+
+ /**
+ * Get a list of permissions assigned to this role.
+ */
+ public function permissions()
+ {
+ return $this->belongsToMany('UserFrosting\Tests\Integration\EloquentTestPermission', 'permission_roles', 'role_id', 'permission_id');
+ }
+}
+
+class EloquentTestPermission extends EloquentTestModel
+{
+ protected $table = 'permissions';
+ protected $guarded = [];
+
+ /**
+ * Get a list of roles that have this permission.
+ */
+ public function roles()
+ {
+ return $this->belongsToMany('UserFrosting\Tests\Integration\EloquentTestRole', 'permission_roles', 'permission_id', 'role_id');
+ }
+}
+
+class EloquentTestTask extends EloquentTestModel
+{
+ protected $table = 'tasks';
+ protected $guarded = [];
+
+ public function locations()
+ {
+ return $this->belongsToMany(
+ 'UserFrosting\Tests\Integration\EloquentTestLocation',
+ 'assignments',
+ 'task_id',
+ 'location_id'
+ );
+ }
+}
+
+class EloquentTestLocation extends EloquentTestModel
+{
+ protected $table = 'locations';
+ protected $guarded = [];
+}
+
+class EloquentTestAssignment extends EloquentTestModel
+{
+ protected $table = 'assignments';
+ protected $guarded = [];
+
+ /**
+ * Get all of the users that are assigned to this assignment.
+ */
+ public function users()
+ {
+ return $this->morphedByMany('UserFrosting\Tests\Integration\EloquentTestUser', 'assignable');
+ }
+}
+
+class EloquentTestJob extends EloquentTestModel
+{
+ protected $table = 'jobs';
+ protected $guarded = [];
+
+ /**
+ * Get the role for this job.
+ */
+ public function role()
+ {
+ return $this->belongsTo('UserFrosting\Tests\Integration\EloquentTestRole', 'role_id');
+ }
+}
diff --git a/login/app/sprinkles/core/tests/Unit/BelongsToManyThroughTest.php b/login/app/sprinkles/core/tests/Unit/BelongsToManyThroughTest.php
new file mode 100755
index 0000000..d4fd4f8
--- /dev/null
+++ b/login/app/sprinkles/core/tests/Unit/BelongsToManyThroughTest.php
@@ -0,0 +1,103 @@
+getRelation();
+
+ // We need to define a mock base query, because Eloquent\Builder will pass through many calls
+ // to this underlying Query\Builder object.
+ $baseQuery = m::mock(QueryBuilder::class);
+ $builder = m::mock(EloquentBuilder::class, [$baseQuery])->makePartial();
+
+ $related = $relation->getRelated();
+ $related->shouldReceive('getQualifiedKeyName')->once()->andReturn('users.id');
+
+ $builder->shouldReceive('withGlobalScope')->once()->andReturnSelf();
+
+ $builder->shouldReceive('limit')->once()->with(2)->andReturnSelf();
+ $builder->shouldReceive('offset')->once()->with(1)->andReturnSelf();
+
+ // Mock the collection generated by the constrained query
+ $collection = m::mock('Illuminate\Database\Eloquent\Collection');
+ $collection->shouldReceive('pluck')->once()->with('id')->andReturn($collection);
+ $collection->shouldReceive('toArray')->once()->andReturn([1,2]);
+ $builder->shouldReceive('get')->once()->andReturn($collection);
+
+ // Test the final modification to the original unpaginated query
+ $builder->shouldReceive('whereIn')->once()->with('users.id', [1,2])->andReturnSelf();
+
+ $paginatedQuery = $relation->getPaginatedQuery($builder, 2, 1);
+ }
+
+ /**
+ * Set up and simulate base expectations for arguments to relationship.
+ */
+ protected function getRelation()
+ {
+ // We simulate a BelongsToManyThrough relationship that gets all related users for a specified permission(s).
+ $builder = m::mock(EloquentBuilder::class);
+ $related = m::mock('Illuminate\Database\Eloquent\Model');
+ $related->shouldReceive('getKey')->andReturn(1);
+ $related->shouldReceive('getTable')->andReturn('users');
+ $related->shouldReceive('getKeyName')->andReturn('id');
+ // Tie the mocked builder to the mocked related model
+ $builder->shouldReceive('getModel')->andReturn($related);
+
+ // Mock the intermediate role->permission BelongsToMany relation
+ $intermediateRelationship = m::mock(BelongsToMany::class);
+ $intermediateRelationship->shouldReceive('getTable')->once()->andReturn('permission_roles');
+ $intermediateRelationship->shouldReceive('getQualifiedRelatedKeyName')->once()->andReturn('permission_roles.role_id');
+ // Crazy pivot query stuff
+ $newPivot = m::mock('\Illuminate\Database\Eloquent\Relations\Pivot');
+ $newPivot->shouldReceive('getForeignKey')->andReturn('permission_id');
+ $intermediateRelationship->shouldReceive('newExistingPivot')->andReturn($newPivot);
+
+ // Expectations for joining the main relation - users to roles
+ $builder->shouldReceive('join')->once()->with('role_users', 'users.id', '=', 'role_users.user_id');
+
+ // Expectations for joining the intermediate relation - roles to permissions
+ $builder->shouldReceive('join')->once()->with('permission_roles', 'permission_roles.role_id', '=', 'role_users.role_id');
+ $builder->shouldReceive('where')->once()->with('permission_id', '=', 1);
+
+ // Now we set up the relationship with the related model.
+ return new BelongsToManyThrough(
+ $builder, $related, $intermediateRelationship, 'role_users', 'role_id', 'user_id', 'relation_name'
+ );
+ }
+}
+
+class EloquentBelongsToManyModelStub extends Model
+{
+ protected $guarded = [];
+}
diff --git a/login/app/sprinkles/core/tests/Unit/DatabaseSyncableTest.php b/login/app/sprinkles/core/tests/Unit/DatabaseSyncableTest.php
new file mode 100755
index 0000000..188b012
--- /dev/null
+++ b/login/app/sprinkles/core/tests/Unit/DatabaseSyncableTest.php
@@ -0,0 +1,119 @@
+getRelation();
+
+ // Simulate determination of related key from builder
+ $relation->getRelated()->shouldReceive('getKeyName')->once()->andReturn('id');
+
+ // Simulate fetching of current relationships (1,2,3)
+ $query = m::mock('stdClass');
+ $relation->shouldReceive('newQuery')->once()->andReturn($query);
+ $query->shouldReceive('pluck')->once()->with('id')->andReturn(new BaseCollection([1, 2, 3]));
+
+ // withoutGlobalScopes will get called exactly 3 times
+ $relation->getRelated()->shouldReceive('withoutGlobalScopes')->times(3)->andReturn($query);
+
+ // Test deletions of items removed from relationship (1)
+ $query->shouldReceive('whereIn')->once()->with('id', [1])->andReturn($query);
+ $query->shouldReceive('delete')->once()->andReturn($query);
+
+ // Test updates to existing items in relationship (2,3)
+ $query->shouldReceive('where')->once()->with('id', 2)->andReturn($query);
+ $query->shouldReceive('update')->once()->with(['id' => 2, 'species' => 'Tyto'])->andReturn($query);
+ $query->shouldReceive('where')->once()->with('id', 3)->andReturn($query);
+ $query->shouldReceive('update')->once()->with(['id' => 3, 'species' => 'Megascops'])->andReturn($query);
+
+ // Test creation of new items ('x')
+ $model = $this->expectCreatedModel($relation, [
+ 'id' => 'x'
+ ]);
+ $model->shouldReceive('getAttribute')->with('id')->andReturn('x');
+
+ $this->assertEquals(['created' => ['x'], 'deleted' => [1], 'updated' => [2,3]], $relation->sync($list));
+ }
+
+ /**
+ * Set up and simulate base expectations for arguments to relationship.
+ */
+ protected function getRelation()
+ {
+ $builder = m::mock('Illuminate\Database\Eloquent\Builder');
+ $builder->shouldReceive('whereNotNull')->with('table.foreign_key');
+ $builder->shouldReceive('where')->with('table.foreign_key', '=', 1);
+ $related = m::mock('Illuminate\Database\Eloquent\Model');
+ $builder->shouldReceive('getModel')->andReturn($related);
+ $parent = m::mock('Illuminate\Database\Eloquent\Model');
+ $parent->shouldReceive('getAttribute')->with('id')->andReturn(1);
+ $parent->shouldReceive('getCreatedAtColumn')->andReturn('created_at');
+ $parent->shouldReceive('getUpdatedAtColumn')->andReturn('updated_at');
+ return new HasManySyncable($builder, $parent, 'table.foreign_key', 'id');
+ }
+
+ public function syncMethodHasManyListProvider()
+ {
+ return [
+ // First test set
+ [
+ // First argument
+ [
+ [
+ 'id' => 2,
+ 'species' => 'Tyto'
+ ],
+ [
+ 'id' => 3,
+ 'species' => 'Megascops'
+ ],
+ [
+ 'id' => 'x'
+ ]
+ ]
+ ]
+ // Additional test sets here
+ ];
+ }
+
+ protected function expectNewModel($relation, $attributes = null)
+ {
+ $relation->getRelated()->shouldReceive('newInstance')->once()->with($attributes)->andReturn($model = m::mock(Model::class));
+ $model->shouldReceive('setAttribute')->with('foreign_key', 1)->andReturn($model);
+ return $model;
+ }
+
+ protected function expectCreatedModel($relation, $attributes)
+ {
+ $model = $this->expectNewModel($relation, $attributes);
+ $model->shouldReceive('save')->andReturn($model);
+ return $model;
+ }
+}
diff --git a/login/app/sprinkles/core/tests/Unit/SprunjeTest.php b/login/app/sprinkles/core/tests/Unit/SprunjeTest.php
new file mode 100755
index 0000000..fa19319
--- /dev/null
+++ b/login/app/sprinkles/core/tests/Unit/SprunjeTest.php
@@ -0,0 +1,100 @@
+ [
+ 'species' => 'Tyto'
+ ]
+ ]);
+
+ $builder = $sprunje->getQuery();
+
+ // Need to mock the new Builder instance that Laravel spawns in the where() closure.
+ // See https://stackoverflow.com/questions/20701679/mocking-callbacks-in-laravel-4-mockery
+ $builder->shouldReceive('newQuery')->andReturn(
+ $subBuilder = m::mock(Builder::class, function ($subQuery) {
+ $subQuery->makePartial();
+ $subQuery->shouldReceive('orLike')->with('species', 'Tyto')->once()->andReturn($subQuery);
+ })
+ );
+
+ $sprunje->applyFilters($builder);
+ }
+
+ function testSprunjeApplySortsDefault()
+ {
+ $sprunje = new SprunjeStub([
+ 'sorts' => [
+ 'species' => 'asc'
+ ]
+ ]);
+
+ $builder = $sprunje->getQuery();
+ $builder->shouldReceive('orderBy')->once()->with('species', 'asc');
+ $sprunje->applySorts($builder);
+ }
+
+}
+
+class SprunjeStub extends Sprunje
+{
+ protected $filterable = [
+ 'species'
+ ];
+
+ protected $sortable = [
+ 'species'
+ ];
+
+ public function __construct($options)
+ {
+ $classMapper = new ClassMapper();
+ parent::__construct($classMapper, $options);
+ }
+
+ protected function baseQuery()
+ {
+ // We use a partial mock for Builder, because we need to be able to run some of its actual methods.
+ // For example, we need to be able to run the `where` method with a closure.
+ $builder = m::mock(Builder::class);
+ $builder->makePartial();
+
+ return $builder;
+ }
+}
+
+class SprunjeTestModelStub extends Model
+{
+ protected $table = 'table';
+}
+
--
cgit v1.2.3