public function access_protected_resource() { global $CONFIG, $THEME_DIR, $USER, $CAT_LIST; global $cpg_udb; // Needed for "lastcomby" meta album in picture list try { $result = $this->verify('access'); if ($result != null) { define('API_CALL', true); $superCage = Inspekt::makeSuperCage(); $matches = $superCage->post->getMatched('function', '/^[a-z]+$/'); switch ($matches[0]) { case 'upload': require 'db_input.php'; break; case 'alblist': define('IN_COPPERMINE', true); require 'include/init.inc.php'; pub_user_albums(); upload_form_alb_list('', ''); break; case 'piclist': define('IN_COPPERMINE', true); require 'include/init.inc.php'; if ($superCage->post->getInt('album')) { pub_user_albums(); upload_form_alb_list('', ''); } else { if ($album = $superCage->post->getAlpha('album')) { $allowed = array('lastcom', 'lastcomby', 'lastup', 'lastupby', 'topn', 'toprated', 'lasthits'); if (!in_array($album, $allowed)) { new OAuthException("Valid meta album names for this function are: 'lastcom', 'lastcomby', 'lastup', 'lastupby', 'topn', 'toprated', and 'lasthits'"); } $USER['uid'] = USER_ID; require 'thumbnails.php'; } else { // No album provided new OAuthException('No album provided via HTTP POST'); } } break; case 'search': define('IN_COPPERMINE', true); require 'include/init.inc.php'; require 'thumbnails.php'; break; case 'catlist': define('IN_COPPERMINE', true); require 'include/init.inc.php'; api_cat_list(); break; default: throw new OAuthException('No function specified via HTTP POST'); } } } catch (OAuthException $e) { header('HTTP/1.1 401 Access Denied'); header('Content-Type: text/xml'); throw new OAuthException($e->getMessage()); } OAuthRequestLogger::flush(); exit; }
function createJFrom($inputFieldType) { // Globalize $CONFIG global $CONFIG, $lang_upload_php, $lang_common, $lang_bbcode_help_title, $lang_bbcode_help; $createJForm = ''; //print $lang_upload_php['pic_title']; /**get the Ablum Drop donw to the varialbe*/ $createJForm .= upload_form_alb_list($lang_common['album'], 'album_array[]', 1); /**get the File input field to the variable*/ if ($inputFieldType == 1) { $createJForm .= file_input('File', 'file_upload_array[]', 1, 1); } if ($inputFieldType == 2) { $createJForm .= text_box_input('URL', 'URI_array[]', 255, 1, '', 'url', '', 1); } /**get the Title input field as a variable*/ $createJForm .= text_box_input($lang_upload_php['pic_title'], 'title_array[]', 255, 1, '', 'title', '', 1); /**get the Text area field to the variable*/ $captionLabel = $lang_upload_php['description']; if ($CONFIG['show_bbcode_help']) { // $captionLabel .= ' '. cpg_display_help('f=empty.htm&base=64&h='.urlencode(base64_encode(serialize($lang_bbcode_help_title))).'&t='.urlencode(base64_encode(serialize($lang_bbcode_help))),470,245); } $createJForm .= text_area_input($captionLabel, 'caption_array[]', $CONFIG['max_img_desc_length'], '', 1); /**get the Text input field to the variable*/ $createJForm .= text_box_input($lang_common['keywords_insert1'], 'keywords_array[]', 255, 1, '', 'serachUp', 'onKeyPress="return disableEnterKey(event)" autocomplete="off"', 1); return $createJForm; }