Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites
View Statistics - Next Notice - Previous NoticeDirectory filter : [ all ] / postnuke_modules / nascar [ view in CVS ]
| Date | Directory [filter] | File(s) [view] | Author [filter] |
| 11 Aug 2002 19:44:06 | postnuke_modules/nascar | pnadmin.php,1.3,1.4 pnadminapi.php,1.2,1.3 pninit.php,1.8,1.9 pnuser.php,1.1,1.2 pnuserapi.php,1.3,1.4 | George Neill |
| + track operations create/update/modify all work now. | |||
Update of /home/cvsroot/postnuke_modules/nascar
In directory ns7.hostnuke.net:/tmp/cvs-serv13706
Modified Files:
pnadmin.php pnadminapi.php pninit.php pnuser.php pnuserapi.php
Log Message:
+ track operations create/update/modify all work now.
+ BL template driven
GNeill 2002.08.11
Index: pnadmin.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/nascar/pnadmin.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pnadmin.php 11 Aug 2002 02:05:02 -0000 1.3
--- pnadmin.php 11 Aug 2002 19:44:04 -0000 1.4
***************
*** 24,27 ****
--- 24,30 ----
// ----------------------------------------------------------------------
+ /*
+ * initial function called from PN
+ */
function nascar_admin_main()
{
***************
*** 35,54 ****
}
function nascar_admin_menu()
{
$data = array();
! $data['nascar_title'] = pnML(pnVarPrepForDisplay(_NASCARTITLE));
! $data['nascar_home'] = pnML(pnVarPrepForDisplay(_NASCARHOME));
!
! $data['nascar_binaries'] = pnML(pnVarPrepForDisplay(_NASCARBINARIES));
! $data['nascar_event'] = pnML(pnVarPrepForDisplay(_NASCAREVENT));
! $data['nascar_leagues'] = pnML(pnVarPrepForDisplay(_NASCARLEAGUES));
! $data['nascar_pen_votes'] = pnML(pnVarPrepForDisplay(_NASCARPENVOTES));
! $data['nascar_penalties'] = pnML(pnVarPrepForDisplay(_NASCARPENALTIES));
! $data['nascar_results'] = pnML(pnVarPrepForDisplay(_NASCARRESULTS));
! $data['nascar_roster'] = pnML(pnVarPrepForDisplay(_NASCARROSTER));
! $data['nascar_season'] = pnML(pnVarPrepForDisplay(_NASCARSEASON));
! $data['nascar_tracks'] = pnML(pnVarPrepForDisplay(_NASCARTRACKS));
$data['status'] = pnGetStatusMsg();
--- 38,59 ----
}
+ /*
+ * nascar administration menu
+ */
function nascar_admin_menu()
{
$data = array();
! $data['nascar_title'] = pnVarPrepForDisplay(pnML(_NASCARTITLE));
! $data['nascar_home'] = pnVarPrepForDisplay(pnML(_NASCARHOME));
! $data['nascar_binaries'] = pnVarPrepForDisplay(pnML(_NASCARBINARIES));
! $data['nascar_event'] = pnVarPrepForDisplay(pnML(_NASCAREVENT));
! $data['nascar_leagues'] = pnVarPrepForDisplay(pnML(_NASCARLEAGUES));
! $data['nascar_pen_votes'] = pnVarPrepForDisplay(pnML(_NASCARPENVOTES));
! $data['nascar_penalties'] = pnVarPrepForDisplay(pnML(_NASCARPENALTIES));
! $data['nascar_results'] = pnVarPrepForDisplay(pnML(_NASCARRESULTS));
! $data['nascar_roster'] = pnVarPrepForDisplay(pnML(_NASCARROSTER));
! $data['nascar_season'] = pnVarPrepForDisplay(pnML(_NASCARSEASON));
! $data['nascar_tracks'] = pnVarPrepForDisplay(pnML(_NASCARTRACKS));
$data['status'] = pnGetStatusMsg();
***************
*** 62,71 ****
if (!pnSecAuthAction(0, 'nascar::', '::', ACCESS_EDIT)) {
! $data['status'] = _NASCARNOAUTH;
return $data;
}
if (!pnModAPILoad('nascar', 'user')) {
! $data['status'] = _LOADFAILED;
return $data;
}
--- 67,78 ----
if (!pnSecAuthAction(0, 'nascar::', '::', ACCESS_EDIT)) {
! $data['status'] = pnVarPrepForDisplay(pnML(_NASCARNOAUTH));
!
return $data;
}
if (!pnModAPILoad('nascar', 'user')) {
! $data['status'] = pnVarPrepForDisplay(pnML(_LOADFAILED));
!
return $data;
}
***************
*** 73,83 ****
$data['items'] = array();
! $data['nascar_addtrack'] = pnML(pnVarPrepForDisplay(_NASCARADDTRACK));
!
! $data['tracks_id'] = pnML(pnVarPrepForDisplay(_TRACKSID));
! $data['tracks_name'] = pnML(pnVarPrepForDisplay(_TRACKSNAME));
! $data['tracks_active'] = pnML(pnVarPrepForDisplay(_TRACKSACTIVE));
!
! $data['pager'] = '';
$items = pnModAPIFunc('nascar',
--- 80,88 ----
$data['items'] = array();
! $data['nascar_addtrack'] = pnVarPrepForDisplay(pnML(_NASCARADDTRACK));
! $data['tracks_id'] = pnVarPrepForDisplay(pnML(_TRACKSID));
! $data['tracks_name'] = pnVarPrepForDisplay(pnML(_TRACKSNAME));
! $data['tracks_active'] = pnVarPrepForDisplay(pnML(_TRACKSACTIVE));
! $data['pager'] = '';
$items = pnModAPIFunc('nascar',
***************
*** 93,97 ****
}
! // do I need to do any clean up here ?
//
// there are no entries in the DB just go ahead and redirect
--- 98,103 ----
}
! // do I need to do any clean up here ? also this could be
! // an error -not- item count of zero.
//
// there are no entries in the DB just go ahead and redirect
***************
*** 136,140 ****
if (!pnSecAuthAction(0, 'nascar::', '::', ACCESS_EDIT)) {
! $data['status'] = _NASCARNOAUTH;
return $data;
--- 142,146 ----
if (!pnSecAuthAction(0, 'nascar::', '::', ACCESS_EDIT)) {
! $data['status'] = pnVarPrepForDisplay(pnML(_NASCARNOAUTH));
return $data;
***************
*** 142,161 ****
$data['authid'] = pnSecGenAuthKey();
!
! $data['nascar_home'] = pnML(pnVarPrepForDisplay(_NASCARHOME));
! $data['nascar_title'] = pnML(pnVarPrepForDisplay(_NASCARTITLE));
!
! $data['label_viewtracks'] = pnML(pnVarPrepForDisplay(_NASCARTRACKS));
!
! $data['label_name'] = pnML(pnVarPrepForDisplay(_TRACKSNAME));
! $data['label_longname'] = pnML(pnVarPrepForDisplay(_TRACKSLONGNAME));
! $data['label_location'] = pnML(pnVarPrepForDisplay(_TRACKSLOCATION));
! $data['label_weather_url'] = pnML(pnVarPrepForDisplay(_TRACKSWEATHERURL));
! $data['label_image'] = pnML(pnVarPrepForDisplay(_TRACKSIMAGE));
! $data['label_length'] = pnML(pnVarPrepForDisplay(_TRACKSLENGTH));
! $data['label_url'] = pnML(pnVarPrepForDisplay(_TRACKSURL));
! $data['label_active'] = pnML(pnVarPrepForDisplay(_TRACKSACTIVE));
!
! $data['addbutton'] = 'Create';
return $data;
--- 148,163 ----
$data['authid'] = pnSecGenAuthKey();
! $data['nascar_home'] = pnVarPrepForDisplay(pnML(_NASCARHOME));
! $data['nascar_title'] = pnVarPrepForDisplay(pnML(_NASCARTITLE));
! $data['label_viewtracks'] = pnVarPrepForDisplay(pnML(_NASCARTRACKS));
! $data['label_name'] = pnVarPrepForDisplay(pnML(_TRACKSNAME));
! $data['label_longname'] = pnVarPrepForDisplay(pnML(_TRACKSLONGNAME));
! $data['label_location'] = pnVarPrepForDisplay(pnML(_TRACKSLOCATION));
! $data['label_weather_url'] = pnVarPrepForDisplay(pnML(_TRACKSWEATHERURL));
! $data['label_image'] = pnVarPrepForDisplay(pnML(_TRACKSIMAGE));
! $data['label_length'] = pnVarPrepForDisplay(pnML(_TRACKSLENGTH));
! $data['label_url'] = pnVarPrepForDisplay(pnML(_TRACKSURL));
! $data['label_active'] = pnVarPrepForDisplay(pnML(_TRACKSACTIVE));
! $data['addbutton'] = pnML('Create');
return $data;
***************
*** 182,197 ****
if (!pnSecConfirmAuthKey()) {
$msg = pnML('Invalid authorization key for creating new #(1) item',
'nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return;
}
if (!pnModAPILoad('nascar', 'admin')) {
! $msg = pnML('Unable to load #(1) admin API',
! 'nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return;
}
--- 184,206 ----
if (!pnSecConfirmAuthKey()) {
+
$msg = pnML('Invalid authorization key for creating new #(1) item',
'nascar');
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return;
}
if (!pnModAPILoad('nascar', 'admin')) {
!
! $msg = pnML('Unable to load #(1) admin API', 'nascar');
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return;
}
***************
*** 211,220 ****
if ($tid == true) {
pnSessionSetVar('statusmsg',
! pnML(pnVarPrepForDisplay(_NASCARTRACKSCREATED)));
}
pnRedirect(pnModURL('nascar', 'admin', 'view_tracks'));
-
return true;
}
--- 220,228 ----
if ($tid == true) {
pnSessionSetVar('statusmsg',
! pnVarPrepForDisplay(pnML(_NASCARTRACKSCREATED)));
}
pnRedirect(pnModURL('nascar', 'admin', 'view_tracks'));
return true;
}
***************
*** 222,228 ****
function nascar_admin_modify_tracks($args)
{
! list($tid,
! $objectid)= pnVarCleanFromInput('tid',
! 'objectid');
extract($args);
--- 230,234 ----
function nascar_admin_modify_tracks($args)
{
! list($tid, $objectid) = pnVarCleanFromInput('tid', 'objectid');
extract($args);
***************
*** 233,237 ****
if (!pnModAPILoad('nascar', 'user')) {
! return pnML('Unable to load user API', 'nascar');
}
--- 239,243 ----
if (!pnModAPILoad('nascar', 'user')) {
! return pnML('Unable to load #(1) user API', 'nascar');
}
***************
*** 239,264 ****
if ($item == false) {
! return pnML('Unable to find', 'nascar', pnVarPrepForDisplay($tid));
}
if (!pnSecAuthAction(0, 'nascar::Item', "$item[tname]::$tid", ACCESS_EDIT)) {
! return pnML('Not authorized to modify ', 'nascar', pnVarPrepForDisplay($tid));
}
return array (
'authid' => pnSecGenAuthKey(),
! 'nascar_home' => pnML(pnVarPrepForDisplay(_NASCARHOME)),
! 'nascar_title' => pnML(pnVarPrepForDisplay(_NASCARTITLE)),
! 'label_viewtracks' => pnML(pnVarPrepForDisplay(_NASCARTRACKS)),
! 'label_id' => pnML(pnVarPrepForDisplay(_TRACKSID)),
! 'label_name' => pnML(pnVarPrepForDisplay(_TRACKSNAME)),
! 'label_longname' => pnML(pnVarPrepForDisplay(_TRACKSLONGNAME)),
! 'label_location' => pnML(pnVarPrepForDisplay(_TRACKSLOCATION)),
! 'label_weather_url' => pnML(pnVarPrepForDisplay(_TRACKSWEATHERURL)),
! 'label_image' => pnML(pnVarPrepForDisplay(_TRACKSIMAGE)),
! 'label_length' => pnML(pnVarPrepForDisplay(_TRACKSLENGTH)),
! 'label_url' => pnML(pnVarPrepForDisplay(_TRACKSURL)),
! 'label_active' => pnML(pnVarPrepForDisplay(_TRACKSACTIVE)),
! 'updatebutton' => pnML('Update'),
'item' => $item
);
--- 245,285 ----
if ($item == false) {
! return pnML('Unable to find #(1) item #(2)',
! 'nascar', pnVarPrepForDisplay($tid));
}
if (!pnSecAuthAction(0, 'nascar::Item', "$item[tname]::$tid", ACCESS_EDIT)) {
! return pnML('Not authorized to modify #(1) item #(2)',
! 'nascar', pnVarPrepForDisplay($tid));
! }
!
! if($item['tactive'])
! {
! // no pnML here!
! $item['yes_active'] = 'CHECKED';
! $item['no_active'] = '';
! }
! else
! {
! // no pnML here!
! $item['yes_active'] = '';
! $item['no_active'] = 'CHECKED';
}
return array (
'authid' => pnSecGenAuthKey(),
! 'nascar_home' => pnVarPrepForDisplay(pnML(_NASCARHOME)),
! 'nascar_title' => pnVarPrepForDisplay(pnML(_NASCARTITLE)),
! 'label_viewtracks' => pnVarPrepForDisplay(pnML(_NASCARTRACKS)),
! 'label_id' => pnVarPrepForDisplay(pnML(_TRACKSID)),
! 'label_name' => pnVarPrepForDisplay(pnML(_TRACKSNAME)),
! 'label_longname' => pnVarPrepForDisplay(pnML(_TRACKSLONGNAME)),
! 'label_location' => pnVarPrepForDisplay(pnML(_TRACKSLOCATION)),
! 'label_weather_url' => pnVarPrepForDisplay(pnML(_TRACKSWEATHERURL)),
! 'label_image' => pnVarPrepForDisplay(pnML(_TRACKSIMAGE)),
! 'label_length' => pnVarPrepForDisplay(pnML(_TRACKSLENGTH)),
! 'label_url' => pnVarPrepForDisplay(pnML(_TRACKSURL)),
! 'label_active' => pnVarPrepForDisplay(pnML(_TRACKSACTIVE)),
! 'updatebutton' => pnML('Update'),
'item' => $item
);
***************
*** 294,301 ****
if (!pnSecConfirmAuthKey()) {
! $msg = pnML('Invalid authorization key for updating ',
'nascar', pnVarPrepForDisplay($tid));
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
--- 315,323 ----
if (!pnSecConfirmAuthKey()) {
! $msg = pnML('Invalid authorization key for #(1) item #(2)',
'nascar', pnVarPrepForDisplay($tid));
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
***************
*** 305,312 ****
if (!pnModAPILoad('nascar', 'admin')) {
! $msg = pnML('Unable to load admin API',
! 'nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return;
--- 327,334 ----
if (!pnModAPILoad('nascar', 'admin')) {
! $msg = pnML('Unable to load #(1) #(2) API', 'nascar','admin');
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
return;
***************
*** 327,331 ****
pnSessionSetVar('statusmsg',
! pnML(pnVarPrepForDisplay(_NASCARTRACKSUPDATED)));
}
--- 349,353 ----
pnSessionSetVar('statusmsg',
! pnVarPrepForDisplay(pnML(_NASCARTRACKSUPDATED)));
}
***************
*** 351,357 ****
if (!pnModAPILoad('nascar', 'user')) {
! $msg = pnML('Unable to load )user API', 'nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return;
}
--- 373,382 ----
if (!pnModAPILoad('nascar', 'user')) {
! $msg = pnML('Unable to load #(1) user API', 'nascar');
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return;
}
***************
*** 360,365 ****
if ($item == false) {
! $msg = pnML('Unable to find ', 'nascar', pnVarPrepForDisplay($tid));
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
--- 385,394 ----
if ($item == false) {
!
! $msg = pnML('Unable to find #(1) item #(2)',
! 'nascar', pnVarPrepForDisplay($tid));
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
***************
*** 368,374 ****
if (!pnSecAuthAction(0, 'nascar::Item', "$item[tname]::$tid", ACCESS_DELETE)) {
! $msg = pnML('Not authorized to delete ',
'nascar', pnVarPrepForDisplay($tid));
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return;
--- 397,405 ----
if (!pnSecAuthAction(0, 'nascar::Item', "$item[tname]::$tid", ACCESS_DELETE)) {
! $msg = pnML('Not authorized to delete #(1) item #(2)',
'nascar', pnVarPrepForDisplay($tid));
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
return;
***************
*** 379,392 ****
$data = nascar_admin_menu();
! $data['tracks_id'] = pnML(pnVarPrepForDisplay(_TRACKSID));
! $data['tid'] = pnML(pnVarPrepForDisplay($tid));
!
! $data['tracks_name'] = pnML(pnVarPrepForDisplay(_TRACKSNAME));
! $data['tracks_name_value'] = pnML(pnVarPrepForDisplay($item['tname']));
!
! $data['confirmtext'] = pnML('Confirm deleting this item ?');
! $data['itemid'] = pnML('Item ID');
! $data['confirmbutton'] = pnML('Confirm');
! $data['authid'] = pnSecGenAuthKey();
return $data;
--- 410,421 ----
$data = nascar_admin_menu();
! $data['tracks_id'] = pnVarPrepForDisplay(pnML(_TRACKSID));
! $data['tid'] = pnVarPrepForDisplay(pnML($tid));
! $data['tracks_name'] = pnVarPrepForDisplay(pnML(_TRACKSNAME));
! $data['tracks_name_value'] = pnVarPrepForDisplay(pnML($item['tname']));
! $data['confirmtext'] = pnML('Confirm deleting this item ?');
! $data['itemid'] = pnML('Item ID');
! $data['confirmbutton'] = pnML('Confirm');
! $data['authid'] = pnSecGenAuthKey();
return $data;
***************
*** 394,401 ****
if (!pnSecConfirmAuthKey()) {
! $msg = pnML('Invalid authorization key for deleting',
'nascar', pnVarPrepForDisplay($tid));
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return;
}
--- 423,434 ----
if (!pnSecConfirmAuthKey()) {
!
! $msg = pnML('Invalid authorization key for deleting #(1) item #(2)',
'nascar', pnVarPrepForDisplay($tid));
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return;
}
***************
*** 403,410 ****
if (!pnModAPILoad('nascar', 'admin')) {
! $msg = pnML('Unable to load admin API', 'nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return;
}
--- 436,445 ----
if (!pnModAPILoad('nascar', 'admin')) {
! $msg = pnML('Unable to load #(1) admin API', 'nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return;
}
***************
*** 416,420 ****
pnSessionSetVar('statusmsg',
! pnML(pnVarPrepForDisplay(_NASCARTRACKSDELETED)));
}
--- 451,455 ----
pnSessionSetVar('statusmsg',
! pnVarPrepForDisplay(pnML(_NASCARTRACKSDELETED)));
}
Index: pnadminapi.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/nascar/pnadminapi.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pnadminapi.php 11 Aug 2002 02:05:02 -0000 1.2
--- pnadminapi.php 11 Aug 2002 19:44:04 -0000 1.3
***************
*** 30,34 ****
//$invalid = array();
! //if (count($invalid) > 0) {
//$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
//join(', ',$invalid), 'admin', 'create_tracks', 'Nascar');
--- 30,34 ----
//$invalid = array();
! //if(count($invalid) > 0) {
//$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
//join(', ',$invalid), 'admin', 'create_tracks', 'Nascar');
***************
*** 38,46 ****
//}
! if (!pnSecAuthAction(0, 'nascar::Item', "$tname::", ACCESS_ADD)) {
! $msg = pnML('Not authorized to add #(1) items',
! 'Nascar');
! pnExceptionSet(PN_USER_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return false;
}
--- 38,52 ----
//}
! if(!pnSecAuthAction(0, 'nascar::Item', "$tname::", ACCESS_ADD)) {
!
! // hmmm... shouldn't we look for DATABASE_ERROR exception
! // being thrown by pnSecAuthAction() ? GN
!
! $msg = pnML('Not authorized to add #(1) items', 'Nascar');
!
! pnExceptionSet(PN_USER_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return false;
}
***************
*** 75,84 ****
$dbconn->Execute($sql);
! if ($dbconn->ErrorNo() != 0) {
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'admin', 'create', 'Nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
new SystemException($msg));
--- 81,91 ----
$dbconn->Execute($sql);
! if($dbconn->ErrorNo() != 0) {
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'admin', 'create', 'Nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'DATABASE_ERROR',
new SystemException($msg));
***************
*** 88,92 ****
$tid = $dbconn->PO_Insert_ID($nascartable, 'pn_tid');
! pnModCallHooks('item', 'create', $tid, 'tid');
return $tid;
--- 95,102 ----
$tid = $dbconn->PO_Insert_ID($nascartable, 'pn_tid');
! if(!pnModCallHooks('item', 'create', $tid, 'tid'))
! {
! // error check here -- GN.
! }
return $tid;
***************
*** 97,113 ****
extract($args);
! if (!isset($tid) || !is_numeric($tid)) {
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
'item ID', 'admin', 'delete_tracks', 'Nascar');
! pnExceptionSet(PN_USER_EXCEPTION, 'BAD_PARAM',
new SystemException($msg));
return false;
}
! if (!pnModAPILoad('nascar', 'user')) {
! $msg = pnML('Unable to load #(1) #(2) API',
! 'nascar','user');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return false;
}
--- 107,130 ----
extract($args);
! if(!isset($tid) || !is_numeric($tid)) {
!
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
'item ID', 'admin', 'delete_tracks', 'Nascar');
!
! pnExceptionSet(PN_USER_EXCEPTION,
! 'BAD_PARAM',
new SystemException($msg));
+
return false;
}
! if(!pnModAPILoad('nascar', 'user')) {
!
! $msg = pnML('Unable to load #(1) #(2) API', 'nascar','user');
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return false;
}
***************
*** 115,131 ****
$item = pnModAPIFunc('nascar', 'user', 'get_tracks', array('tid' => $tid));
! if ($item == false) {
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
'item ID', 'user', 'get_tracks', 'Nascar');
! pnExceptionSet(PN_USER_EXCEPTION, 'BAD_PARAM',
new SystemException($msg));
return false;
}
! if (!pnSecAuthAction(0, 'nascar::Item', "$item[tname]::$tid", ACCESS_DELETE)) {
$msg = pnML('Not authorized to delete #(1) item #(2)',
'Nascar', pnVarPrepForStore($tid));
! pnExceptionSet(PN_USER_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return false;
}
--- 132,155 ----
$item = pnModAPIFunc('nascar', 'user', 'get_tracks', array('tid' => $tid));
! if($item == false) {
!
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
'item ID', 'user', 'get_tracks', 'Nascar');
!
! pnExceptionSet(PN_USER_EXCEPTION,
! 'BAD_PARAM',
new SystemException($msg));
+
return false;
}
! if(!pnSecAuthAction(0, 'nascar::Item', "$item[tname]::$tid", ACCESS_DELETE)) {
$msg = pnML('Not authorized to delete #(1) item #(2)',
'Nascar', pnVarPrepForStore($tid));
!
! pnExceptionSet(PN_USER_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return false;
}
***************
*** 140,152 ****
$dbconn->Execute($sql);
! if ($dbconn->ErrorNo() != 0) {
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'admin', 'delete_tracks', 'Nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
new SystemException($msg));
return false;
}
! pnModCallHooks('item', 'delete_tracks', $tid, '');
return true;
--- 164,183 ----
$dbconn->Execute($sql);
! if($dbconn->ErrorNo() != 0) {
!
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'admin', 'delete_tracks', 'Nascar');
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'DATABASE_ERROR',
new SystemException($msg));
+
return false;
}
! if(!pnModCallHooks('item', 'delete_tracks', $tid, ''))
! {
! // error check here -- GN
! }
return true;
***************
*** 161,173 ****
if(!isset($tid))
{
! $invalid[] = "track id";
}
! if (count($invalid) > 0) {
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
join(', ',$invalid), 'admin', 'update_tracks', 'Nascar');
! pnExceptionSet(PN_USER_EXCEPTION, 'BAD_PARAM',
new SystemException($msg));
--- 192,205 ----
if(!isset($tid))
{
! $invalid[] = pnML("track id");
}
! if(count($invalid) > 0) {
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
join(', ',$invalid), 'admin', 'update_tracks', 'Nascar');
! pnExceptionSet(PN_USER_EXCEPTION,
! 'BAD_PARAM',
new SystemException($msg));
***************
*** 175,183 ****
}
! if (!pnModAPILoad('nascar', 'user')) {
$msg = pnML('Unable to load #(1) #(2) API',
'nascar','user');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return false;
}
--- 207,219 ----
}
! if(!pnModAPILoad('nascar', 'user')) {
!
$msg = pnML('Unable to load #(1) #(2) API',
'nascar','user');
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return false;
}
***************
*** 185,208 ****
$item = pnModAPIFunc('nascar', 'user', 'get_tracks', array('tid' => $tid));
! if ($item == false) {
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
'item ID', 'user', 'get_tracks', 'Nascar');
! pnExceptionSet(PN_USER_EXCEPTION, 'BAD_PARAM',
new SystemException($msg));
return false;
}
! if (!pnSecAuthAction(0, 'nascar::Item', "$item[tname]::$tid", ACCESS_EDIT)) {
$msg = pnML('Not authorized to edit #(1) item #(2)',
'Nascar', pnVarPrepForStore($tid));
! pnExceptionSet(PN_USER_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return false;
}
! if (!pnSecAuthAction(0, 'nascar::Item', "$tname::$tid", ACCESS_EDIT)) {
$msg = pnML('Not authorized to edit #(1) item #(2)',
'Nascar', pnVarPrepForStore($tid));
! pnExceptionSet(PN_USER_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return false;
--- 221,255 ----
$item = pnModAPIFunc('nascar', 'user', 'get_tracks', array('tid' => $tid));
! if($item == false) {
!
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
'item ID', 'user', 'get_tracks', 'Nascar');
!
! pnExceptionSet(PN_USER_EXCEPTION,
! 'BAD_PARAM',
new SystemException($msg));
+
return false;
}
! if(!pnSecAuthAction(0, 'nascar::Item', "$item[tname]::$tid", ACCESS_EDIT)) {
!
$msg = pnML('Not authorized to edit #(1) item #(2)',
'Nascar', pnVarPrepForStore($tid));
!
! pnExceptionSet(PN_USER_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return false;
}
! if(!pnSecAuthAction(0, 'nascar::Item', "$tname::$tid", ACCESS_EDIT)) {
!
$msg = pnML('Not authorized to edit #(1) item #(2)',
'Nascar', pnVarPrepForStore($tid));
!
! pnExceptionSet(PN_USER_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
return false;
***************
*** 214,234 ****
$sql = "UPDATE $nascartable
! SET pn_track_name = '" . pnVarPrepForStore($tname) . "',
! pn_longname = '" . pnVarPrepForStore($tlongname) . "',
! pn_location = '" . pnVarPrepForStore($tlocation) . "',
! pn_weather_url = '" . pnVarPrepForStore($tweather_url) ."',
! pn_track_image = '" . pnVarPrepForStore($timage) . "',
! pn_track_length = '" . pnVarPrepForStore($tlength) . "',
! pn_track_url = '" . pnVarPrepForStore($turl) . "',
! pn_active = " . pnVarPrepForStore($tactive) . "
WHERE pn_track_id = " . pnVarPrepForStore($tid);
$dbconn->Execute($sql);
! if ($dbconn->ErrorNo() != 0) {
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'admin', 'update_tracks', 'Nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
new SystemException($msg));
return false;
}
--- 261,285 ----
$sql = "UPDATE $nascartable
! SET pn_track_name = '" . pnVarPrepForStore($tname) . "',
! pn_longname = '" . pnVarPrepForStore($tlongname) . "',
! pn_location = '" . pnVarPrepForStore($tlocation) . "',
! pn_weather_url = '" . pnVarPrepForStore($tweather_url) . "',
! pn_track_image = '" . pnVarPrepForStore($timage) . "',
! pn_track_length = '" . pnVarPrepForStore($tlength) . "',
! pn_track_url = '" . pnVarPrepForStore($turl) . "',
! pn_active = " . pnVarPrepForStore($tactive) . "
WHERE pn_track_id = " . pnVarPrepForStore($tid);
$dbconn->Execute($sql);
! if($dbconn->ErrorNo() != 0) {
!
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'admin', 'update_tracks', 'Nascar');
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'DATABASE_ERROR',
new SystemException($msg));
+
return false;
}
Index: pninit.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/nascar/pninit.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** pninit.php 8 Aug 2002 10:18:42 -0000 1.8
--- pninit.php 11 Aug 2002 19:44:04 -0000 1.9
***************
*** 113,117 ****
! //-------------------------------------------------------------------------
// create the LEAGUES table contains attributes on each league
//-------------------------------------------------------------------------
--- 113,117 ----
! //-------------------------------------------------------------------------
// create the LEAGUES table contains attributes on each league
//-------------------------------------------------------------------------
***************
*** 305,310 ****
//-------------------------------------------------------------------------
! // create the SEASON table contains attributes on each season
! // within a league
//-------------------------------------------------------------------------
$sql[] = pnDBCreateTable(
--- 305,309 ----
//-------------------------------------------------------------------------
! // the SEASON table contains attributes on each season within a league
//-------------------------------------------------------------------------
$sql[] = pnDBCreateTable(
Index: pnuser.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/nascar/pnuser.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pnuser.php 10 Aug 2002 06:02:33 -0000 1.1
--- pnuser.php 11 Aug 2002 19:44:04 -0000 1.2
***************
*** 21,30 ****
// ----------------------------------------------------------------------
// Original Author of file: George Neill
! // Purpose of file: Template user display functions
// ----------------------------------------------------------------------
function nascar_user_main()
{
! if (!pnSecAuthAction(0, 'Template::', '::', ACCESS_OVERVIEW)) {
return _NASCARNOAUTH;
}
--- 21,30 ----
// ----------------------------------------------------------------------
// Original Author of file: George Neill
! // Purpose of file: Nascar user display functions
// ----------------------------------------------------------------------
function nascar_user_main()
{
! if (!pnSecAuthAction(0, 'nascar::', '::', ACCESS_OVERVIEW)) {
return _NASCARNOAUTH;
}
***************
*** 44,57 ****
$data['status'] = '';
$data['items'] = array();
! $data['someheader'] = _NASCARNAME;
$data['pager'] = '';
! if (!pnSecAuthAction(0, 'Templates::', '::', ACCESS_OVERVIEW)) {
! $data['status'] = _NASCARNOAUTH;
return $data;
}
if (!pnModAPILoad('nascar', 'user')) {
! $data['status'] = _LOADFAILED;
return $data;
--- 44,57 ----
$data['status'] = '';
$data['items'] = array();
! $data['someheader'] = pnVarPrepForDisplay(pnML(_NASCARNAME));
$data['pager'] = '';
! if (!pnSecAuthAction(0, 'nascars::', '::', ACCESS_OVERVIEW)) {
! $data['status'] = pnVarPrepForDisplay(pnML(_NASCARNOAUTH));
return $data;
}
if (!pnModAPILoad('nascar', 'user')) {
! $data['status'] = pnVarPrepForDisplay(pnML(_LOADFAILED));
return $data;
***************
*** 69,73 ****
return; // throw back
}
! $data['status'] = _NASCARITEMFAILED;
$reason = pnExceptionValueString();
--- 69,73 ----
return; // throw back
}
! $data['status'] = pnVarPrepForDisplay(pnML(_NASCARITEMFAILED));
$reason = pnExceptionValueString();
***************
*** 101,105 ****
// link to display the details of the item
if (pnSecAuthAction(0,
! 'Templates::',
"$item[name]::$item[tid]",
ACCESS_READ)) {
--- 101,105 ----
// link to display the details of the item
if (pnSecAuthAction(0,
! 'nascars::',
"$item[name]::$item[tid]",
ACCESS_READ)) {
***************
*** 143,147 ****
$data['pager'] = $output->GetOutput();
! $data['someheader'] = _NASCARNAME;
return $data;
--- 143,147 ----
$data['pager'] = $output->GetOutput();
! $data['someheader'] = pnVarPrepForDisplay(pnML(_NASCARNAME));
return $data;
***************
*** 178,182 ****
return; // throw back
}
! $data['status'] = _NASCARITEMFAILED;
$reason = pnExceptionValueString();
--- 178,182 ----
return; // throw back
}
! $data['status'] = pnVarPrepForDisplay(pnML(_NASCARITEMFAILED));
$reason = pnExceptionValueString();
***************
*** 199,208 ****
// pnVarCensor / input parsing of Text() by pnHTML
! $data['name_label'] = _NASCARNAME;
! $data['name_value'] = pnVarCensor($item['name']);
! $data['number_label'] = _NASCARNUMBER;
! $data['number_value'] = $item['number'];
! $data['is_bold'] = pnModGetVar('nascar', 'bold');
$data['hookoutput'] = pnModCallHooks('item',
--- 199,208 ----
// pnVarCensor / input parsing of Text() by pnHTML
! $data['name_label'] = pnVarPrepForDisplay(pnML(_NASCARNAME);
! $data['name_value'] = pnVarPrepForDisplay(pnML(pnVarCensor($item['name'])));
! $data['number_label'] = pnVarPrepForDisplay(pnML(_NASCARNUMBER));
! $data['number_value'] = pnVarPrepForDisplay(pnML($item['number']));
! $data['is_bold'] = pnVarPrepForDisplay(pnML(pnModGetVar('nascar', 'bold')));
$data['hookoutput'] = pnModCallHooks('item',
***************
*** 221,228 ****
$menu = array();
! $menu['menutitle'] = _NASCAR;
!
! $menu['menulabel_view'] = _NASCARVIEW;
! $menu['menulink_view'] = pnModURL('nascar','user','view');
return $menu;
--- 221,227 ----
$menu = array();
! $menu['menutitle'] = pnVarPrepForDisplay(pnML(_NASCAR));
! $menu['menulabel_view'] = pnVarPrepForDisplay(pnML(_NASCARVIEW));
! $menu['menulink_view'] = pnModURL('nascar','user','view');
return $menu;
Index: pnuserapi.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/nascar/pnuserapi.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pnuserapi.php 11 Aug 2002 02:05:02 -0000 1.3
--- pnuserapi.php 11 Aug 2002 19:44:04 -0000 1.4
***************
*** 39,47 ****
if (!isset($startnum) || !is_numeric($startnum)) {
! $invalid[] = 'startnum';
}
if (!isset($numitems) || !is_numeric($numitems)) {
! $invalid[] = 'numitems';
}
--- 39,47 ----
if (!isset($startnum) || !is_numeric($startnum)) {
! $invalid[] = pnML('startnum');
}
if (!isset($numitems) || !is_numeric($numitems)) {
! $invalid[] = pnML('numitems');
}
***************
*** 49,54 ****
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
join(', ',$invalid), 'user', 'getall_tracks', 'Nascar');
! pnExceptionSet(PN_USER_EXCEPTION, 'BAD_PARAM',
new SystemException($msg));
return false;
}
--- 49,57 ----
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
join(', ',$invalid), 'user', 'getall_tracks', 'Nascar');
!
! pnExceptionSet(PN_USER_EXCEPTION,
! 'BAD_PARAM',
new SystemException($msg));
+
return false;
}
***************
*** 57,64 ****
if (!pnSecAuthAction(0, 'nascar::', '::', ACCESS_OVERVIEW)) {
! $msg = pnML('Not authorized to access #(1) items',
! 'Nascar');
! pnExceptionSet(PN_USER_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return false;
}
--- 60,69 ----
if (!pnSecAuthAction(0, 'nascar::', '::', ACCESS_OVERVIEW)) {
! $msg = pnML('Not authorized to access #(1) items', 'Nascar');
!
! pnExceptionSet(PN_USER_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return false;
}
***************
*** 86,91 ****
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'user', 'getall_tracks', 'Nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
new SystemException($msg));
return false;
}
--- 91,99 ----
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'user', 'getall_tracks', 'Nascar');
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'DATABASE_ERROR',
new SystemException($msg));
+
return false;
}
***************
*** 128,132 ****
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
'item ID', 'user', 'get_tracks', 'Nascar');
! pnExceptionSet(PN_USER_EXCEPTION, 'BAD_PARAM',
new SystemException($msg));
return false;
--- 136,142 ----
$msg = pnML('Invalid #(1) for #(2) function #(3)() in module #(4)',
'item ID', 'user', 'get_tracks', 'Nascar');
!
! pnExceptionSet(PN_USER_EXCEPTION,
! 'BAD_PARAM',
new SystemException($msg));
return false;
***************
*** 154,159 ****
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'user', 'get_tracks', 'Nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
new SystemException($msg));
return false;
}
--- 164,172 ----
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'user', 'get_tracks', 'Nascar');
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'DATABASE_ERROR',
new SystemException($msg));
+
return false;
}
***************
*** 179,184 ****
$msg = pnML('Not authorized to access #(1) item #(2)',
'Nascar', pnVarPrepForStore($tid));
! pnExceptionSet(PN_USER_EXCEPTION, 'NO_PERMISSION',
new SystemException($msg));
return false;
}
--- 192,200 ----
$msg = pnML('Not authorized to access #(1) item #(2)',
'Nascar', pnVarPrepForStore($tid));
!
! pnExceptionSet(PN_USER_EXCEPTION,
! 'NO_PERMISSION',
new SystemException($msg));
+
return false;
}
***************
*** 208,213 ****
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'user', 'countitems_tracks', 'Nascar');
! pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE_ERROR',
new SystemException($msg));
return false;
}
--- 224,232 ----
$msg = pnML('Database error for #(1) function #(2)() in module #(3)',
'user', 'countitems_tracks', 'Nascar');
!
! pnExceptionSet(PN_SYSTEM_EXCEPTION,
! 'DATABASE_ERROR',
new SystemException($msg));
+
return false;
}
View Statistics - Next Notice - Previous Notice
| Visit Developer Site - Browse CVS Repository |
Syndicate via backend.rss (max. once per hour please) | Powered by CVSNotice 0.1.3 |