<?php
/***************************************************************************
 *  For license information see doc/license.txt
 *
 *  Unicode Reminder メモ
 *
 *  Business layer constant definitions
 ***************************************************************************/

	define('ID_NEW', -1);

	define('RE_TYPE_INT', 1);
	define('RE_TYPE_STRING', 2);
	define('RE_TYPE_BOOLEAN', 3);
	define('RE_TYPE_DATE', 4);
	define('RE_TYPE_FLOAT', 5);
	define('RE_TYPE_DOUBLE', 6);

	define('RE_INSERT_NOTHING', 0);       // 
	define('RE_INSERT_OVERWRITE', 1);     // ignore given values and use function
	define('RE_INSERT_IGNORE', 2);        // dont use this column on insert
	define('RE_INSERT_AUTOINCREMENT', 4); // column is an auto increment column
	define('RE_INSERT_AUTOUUID', 8);      // if empty, UUID is generated by before insert trigger (not supported for primary key fields)
	define('RE_INSERT_NOW', 16);          // NOW()

	define('REGEX_USERNAME', '^[a-zA-Z0-9\.\-_@äüöÄÜÖ=)(\/\\\&*+~#][a-zA-Z0-9\.\-_ @äüöÄÜÖ=)(\/\\\&*+~#]{1,58}[a-zA-Z0-9\.\-_@äüöÄÜÖ=)(\/\\\&*+~#]$'); // if chars changed, ajust webchat.php //   // min. 4 -> 3 chars -- following 2012-8-6
	define('REGEX_PASSWORD', '^[a-zA-Z0-9\.\-_ @äüöÄÜÖ=)(\/\\\&*+~#]{3,60}$');
	define('REGEX_LAST_NAME', '^[a-zA-Z][a-zA-Z0-9\.\- äüöÄÜÖ]{1,59}$');
	define('REGEX_FIRST_NAME', '^[a-zA-Z][a-zA-Z0-9\.\- äüöÄÜÖ]{1,59}$');
	define('REGEX_STATPIC_TEXT', '^[a-zA-Z0-9\.\-_ @äüöÄÜÖß=)(\/\\\&*\$+~#!§%;,-?:\[\]{}¹²³\'\"`\|µ°\%]{0,30}$');

	define('ADMIN_TRANSLATE', 1);     // edit translation
	define('ADMIN_MAINTAINANCE', 2);  // check table etc.
	define('ADMIN_USER', 4);          // drop users, caches etc.
	define('ADMIN_NEWS', 8);          // approve news entries
	define('ADMIN_RESTORE', 16);      // restore vandalized listings
	define('ADMIN_ROOT', 128 | 127);  // root + all previous rights
	define('ADMIN_LISTING', 1024);    // can edit any cache listings

	define('ATTRIB_SELECTED', 1);
	define('ATTRIB_UNSELECTED', 2);
	define('ATTRIB_UNDEF', 3);

	define('ATTRIB_ID_SAFARI', 61);

	define('OBJECT_CACHELOG', 1);
	define('OBJECT_CACHE', 2);
	define('OBJECT_CACHEDESC', 3);
	define('OBJECT_USER', 4);
	define('OBJECT_TRAVELER', 5);
	define('OBJECT_PICTURE', 6);
	define('OBJECT_REMOVEDOBJECT', 7);
	define('OBJECT_WAYPOINT', 8);

	// coordinate types
	define('COORDINATE_WAYPOINT', 1);
	define('COORDINATE_USERNOTE', 2);

	define('MAX_LOGENTRIES_ON_CACHEPAGE', 5);
	define('MAX_PICTURES_PER_GALLERY_PAGE', 48);   // must be multiple of 6

	// threshold for caches to be marked as "new"
	// changed from 7 to 14  -- following 2013/6/17
	define('NEWCACHES_DAYS', 14);

	// constants for user options (must match values in DB!)
	define('USR_OPT_GMZOOM', 1);
	define('USR_OPT_SHOWSTATS', 5);
	define('USR_OPT_MAP_MENU', 6);
	define('USR_OPT_MAP_OVERVIEW', 7);
	define('USR_OPT_MAP_MAXCACHES', 8);
	define('USR_OPT_MAP_ICONSET', 9);
	define('USR_OPT_MAP_PREVIEW', 10);
	define('USR_OPT_PICSTAT', 11);
	define('USR_OPT_TRANSLANG', 12);
	define('USR_OPT_OCONLY81', 13);
	define('USR_OPT_LOG_AUTOLOAD', 14);

	// user.data_license values
	define('OLD_DATA_LICSENSE',0);                       // before deadline
	define('NEW_DATA_LICENSE_ACTIVELY_DECLINED',1);      // declined license
	define('NEW_DATA_LICENSE_ACTIVELY_ACCEPTED',2);      // accepted new license on registration
	define('NEW_DATA_LICENSE_PASSIVELY_ACCEPTED',3);     // did not decline license until deadline
	define('NEW_DATA_LICENSE_PASSIVELY_DECLINED',4);     // could not accept/decline because disabled

?>