Changeset 124
- Timestamp:
- May 24, 2006 5:35:19 AM (18 years ago)
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1dev/bin/module_maker/module.cli.php
r109 r124 422 422 echo "Attempting to create user trash folder: $user_trash_folder/\n"; 423 423 mkdir($user_trash_folder); 424 chmod($user_trash_folder, 07 77);424 chmod($user_trash_folder, 0700); 425 425 } 426 426 if (!is_dir("$user_trash_folder") || !is_writable("$user_trash_folder")) { -
trunk/bin/module_maker/skel/adm_list.ihtml
r121 r124 28 28 <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?> 29 29 <tr> 30 <td class=" padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['<##>'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> </td>31 <td class=" padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['<##>'])) ?>" href="<?php echo App::oHREF('/admin/versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> </td>30 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['<##>'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=edit&%PRIMARY_KEY%=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> </td> 31 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['<##>'])) ?>" href="<?php echo App::oHREF('/admin/versions.php?record_table=%DB_TBL%&record_key=%PRIMARY_KEY%&boomerang=true&record_val=' . $list[$i]['%PRIMARY_KEY%']); ?>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> </td> 32 32 %ADM_LIST_ROWS% 33 <td class=" padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['<##>'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onClick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['<##>'])) ?>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> </td>33 <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['<##>'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . "?op=del&%PRIMARY_KEY%=" . $list[$i]['%PRIMARY_KEY%']); ?>" onClick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['<##>'])) ?>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> </td> 34 34 </tr> 35 35 <?php } ?> -
trunk/docs/revision_history.txt
r42 r124 1 -------------------------------------------------------------------------------- 1 --------------------------------------------------------------------- 2 Strangecode codebase 2.1 3 --------------------------------------------------------------------- 4 5 css/utilities.inc.php and css/codebase.inc.php now have sc- prepended to all selectors. This regex will convert an existing site to the new sc- format: 6 s/class="([\w-]+ )*(tiny|small|medium|large|full|twolines|short|tall|fullscreen|nowrap|clearboth|center|right|padright|padleft|padleft|help|monospaced|pkg)( [\w-]+)*"/class="$1sc-$2$3"/gi 7 8 9 10 --------------------------------------------------------------------- 2 11 Strangecode codebase 2.0 3 --------------------------------------------------------------------- -----------12 --------------------------------------------------------------------- 4 13 5 14 Codebase self contained. runs without reference to external files or info. … … 69 78 70 79 71 --------------------------------------------------------------------- -----------80 --------------------------------------------------------------------- 72 81 Strangecode codebase 1.0.0 release 73 --------------------------------------------------------------------- -----------82 --------------------------------------------------------------------- 74 83 75 84 This is the primary stable release used before we started using Subversion. It was maintained erratically by one erratic person. No revision info documented, sorry. -
trunk/lib/App.inc.php
r119 r124 1107 1107 function sslOff() 1108 1108 { 1109 if (!isset($this) || !is_a($this, 'App') && !is_subclass_of($this, 'App')) { 1110 $this =& App::getInstance(); 1111 } 1112 1109 1113 if ('' != getenv('HTTPS')) { 1110 1114 $this->dieURL('http://' . getenv('HTTP_HOST') . getenv('REQUEST_URI'), null, true); -
trunk/lib/Auth_SQL.inc.php
r121 r124 4 4 * 5 5 * @author Quinn Comendant <quinn@strangecode.com> 6 * @version 2. 06 * @version 2.1 7 7 */ 8 8 9 9 // Available encryption types for class Auth_SQL. 10 define('AUTH_ENCRYPT_MD5', 'md5');11 define('AUTH_ENCRYPT_CRYPT', 'crypt');12 define('AUTH_ENCRYPT_SHA1', 'sha1');13 define('AUTH_ENCRYPT_PLAINTEXT', 'plaintext');10 define('AUTH_ENCRYPT_MD5', 1); 11 define('AUTH_ENCRYPT_CRYPT', 2); 12 define('AUTH_ENCRYPT_SHA1', 3); 13 define('AUTH_ENCRYPT_PLAINTEXT', 4); 14 14 15 15 require_once dirname(__FILE__) . '/Email.inc.php'; … … 41 41 42 42 // The type of encryption to use for passwords stored in the db_table. Use one of the AUTH_ENCRYPT_* types specified above. 43 'encryption_type' => AUTH_ENCRYPT_ MD5,43 'encryption_type' => AUTH_ENCRYPT_SHA1, 44 44 45 45 // The URL to the login script. … … 47 47 48 48 // The maximum amount of time a user is allowed to be logged in. They will be forced to login again if they expire. 49 // This applies to admins and users.In seconds. 21600 seconds = 6 hours.49 // In seconds. 21600 seconds = 6 hours. 50 50 'login_timeout' => 21600, 51 51 52 52 // The maximum amount of time a user is allowed to be idle before their session expires. They will be forced to login again if they expire. 53 // This applies to admins and users.In seconds. 3600 seconds = 1 hour.53 // In seconds. 3600 seconds = 1 hour. 54 54 'idle_timeout' => 3600, 55 55 … … 300 300 $this->initDB(); 301 301 302 // Query DB for user matching credentials. 303 // FIXME: Cannot compare crypt style passwords this way. 304 $qid = DB::query(" 305 SELECT *, " . $this->_params['db_primary_key'] . " AS user_id 306 FROM " . $this->_params['db_table'] . " 307 WHERE " . $this->_params['db_username_column'] . " = '" . DB::escapeString($username) . "' 308 AND BINARY userpass = '" . DB::escapeString($this->encryptPassword($password)) . "' 309 "); 302 switch ($this->_params['encryption_type']) { 303 case AUTH_ENCRYPT_CRYPT : 304 // Query DB for user matching credentials. Compare cyphertext with salted-encrypted password. 305 $qid = DB::query(" 306 SELECT *, " . $this->_params['db_primary_key'] . " AS user_id 307 FROM " . $this->_params['db_table'] . " 308 WHERE " . $this->_params['db_username_column'] . " = '" . DB::escapeString($username) . "' 309 AND BINARY userpass = ENCRYPT('" . DB::escapeString($password) . "', LEFT(userpass, 2))) 310 "); 311 break; 312 case AUTH_ENCRYPT_PLAINTEXT : 313 case AUTH_ENCRYPT_MD5 : 314 case AUTH_ENCRYPT_SHA1 : 315 default : 316 // Query DB for user matching credentials. Directly compare cyphertext with result from encryptPassword(). 317 $qid = DB::query(" 318 SELECT *, " . $this->_params['db_primary_key'] . " AS user_id 319 FROM " . $this->_params['db_table'] . " 320 WHERE " . $this->_params['db_username_column'] . " = '" . DB::escapeString($username) . "' 321 AND BINARY userpass = '" . DB::escapeString($this->encryptPassword($password)) . "' 322 "); 323 break; 324 } 310 325 311 326 // Return user data if found. … … 665 680 function generatePassword($pattern='CvccvCdd') 666 681 { 667 mt_srand((double) microtime() * 10000000);668 682 $str = ''; 669 683 for ($i=0; $i<strlen($pattern); $i++) { … … 682 696 * 683 697 */ 684 function encryptPassword($password )698 function encryptPassword($password, $salt=null) 685 699 { 686 700 switch ($this->_params['encryption_type']) { … … 690 704 691 705 case AUTH_ENCRYPT_CRYPT : 692 return crypt($password); 706 // If comparing plaintext password with a hash, provide first two chars of the hash as the salt. 707 return isset($salt) ? crypt($password, substr($salt, 0, 2)) : crypt($password); 693 708 break; 694 709 695 710 case AUTH_ENCRYPT_SHA1 : 696 return sha1( $password);711 return sha1(App::getParam('signing_key') . sha1($password)); 697 712 break; 698 713 699 714 case AUTH_ENCRYPT_MD5 : 700 715 default : 701 return md5( $password);716 return md5(App::getParam('signing_key') . md5($password)); 702 717 break; 703 718 } -
trunk/lib/PEdit.inc.php
r121 r124 276 276 ?> 277 277 <label><?php echo ucfirst(str_replace('_', ' ', $name)); ?></label> 278 <textarea name="_pedit_data[<?php echo $name; ?>]" id="sc-pedit-field-<?php echo $name; ?>" rows="" cols="" class=" full sc-tall"><?php echo oTxt($this->_data[$name]['content']); ?></textarea>278 <textarea name="_pedit_data[<?php echo $name; ?>]" id="sc-pedit-field-<?php echo $name; ?>" rows="" cols="" class="sc-full sc-tall"><?php echo oTxt($this->_data[$name]['content']); ?></textarea> 279 279 <?php 280 280 break; -
trunk/services/templates/admin_list.ihtml
r121 r124 31 31 <?php for ($i = 0; $i <= $page->last_item - $page->first_item && $page->total_items > 0; $i++) { ?> 32 32 <tr> 33 <td class=" padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $list[$i]['admin_id']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> </td>34 <td class=" padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF('/admin/versions.php?record_table=admin_tbl&record_key=admin_id&boomerang=true&record_val=' . $list[$i]['admin_id']); ?>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> </td>33 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Edit %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $list[$i]['admin_id']); ?>"><img src="/admin/_widgets/edit.gif" alt="Edit" width="14" height="18" border="0"></a> </td> 34 <td class="sc-padleft sc-nowrap"><a title="<?php printf(_("Versions of %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF('/admin/versions.php?record_table=admin_tbl&record_key=admin_id&boomerang=true&record_val=' . $list[$i]['admin_id']); ?>"><img src="/admin/_widgets/subcategory.gif" alt="" width="18" height="14" border="0" /></a> </td> 35 35 <td class="sc-nowrap"><?php echo oTxt($list[$i]['admin_id'], true); ?> </td> 36 36 <td class="sc-nowrap"><?php echo oTxt($list[$i]['username'], true); ?> </td> … … 49 49 <td class="sc-nowrap"><?php echo oTxt($list[$i]['added_admin_username'], true); ?> </td> 50 50 <td class="sc-nowrap"><?php echo '0000-00-00 00:00:00' == $list[$i]['modified_datetime'] ? '' : date(App::getParam('date_format'), strtotime($list[$i]['modified_datetime'])); ?> </td> 51 <td class=" padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . "?op=del&admin_id=" . $list[$i]['admin_id']); ?>" onClick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['username'])) ?>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> </td>51 <td class="sc-padleft sc-nowrap" align="right"><a title="<?php printf(_("Delete %s"), oTxt($list[$i]['username'])) ?>" href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . "?op=del&admin_id=" . $list[$i]['admin_id']); ?>" onClick="javascript:return confirm('<?php printf(_("Are you sure you want to delete the record %s? This action is permanent and cannot be undone."), oTxt($list[$i]['username'])) ?>')"><img src="/admin/_widgets/delete.gif" alt="Delete" width="16" height="17" border="0"></a> </td> 52 52 </tr> 53 53 <?php } ?> -
trunk/services/templates/versions_diff.ihtml
r121 r124 20 20 ?> 21 21 <tr> 22 <td class=" padleft sc-nowrap"<?php echo $style; ?>><label><?php echo $k; ?></label></td>22 <td class="sc-padleft sc-nowrap"<?php echo $style; ?>><label><?php echo $k; ?></label></td> 23 23 <td class="sc-padleft"><?php echo $v_d; ?></td> 24 24 <td class="sc-padleft"><?php echo $v_c; ?></td> -
trunk/services/templates/versions_list.ihtml
r121 r124 14 14 <tr> 15 15 <?php if ($first) { ?> 16 <td class=" padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=view¤t=true&version_id=' . $v['version_id']); ?>">view</a>]</td>17 <td class=" padleft sc-nowrap" colspan="2">(<?php echo _("Current record"); ?>)</td>16 <td class="sc-padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=view¤t=true&version_id=' . $v['version_id']); ?>">view</a>]</td> 17 <td class="sc-padleft sc-nowrap" colspan="2">(<?php echo _("Current record"); ?>)</td> 18 18 <?php } else { ?> 19 <td class=" padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=view&version_id=' . $v['version_id']); ?>">view</a>]</td>20 <td class=" padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=diff&version_id=' . $v['version_id']); ?>">diff</a>]</td>21 <td class=" padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=restore&version_id=' . $v['version_id']); ?>">restore</a>]</td>19 <td class="sc-padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=view&version_id=' . $v['version_id']); ?>">view</a>]</td> 20 <td class="sc-padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=diff&version_id=' . $v['version_id']); ?>">diff</a>]</td> 21 <td class="sc-padleft sc-nowrap">[<a href="<?php echo App::oHREF($_SERVER['PHP_SELF'] . '?op=restore&version_id=' . $v['version_id']); ?>">restore</a>]</td> 22 22 <?php } ?> 23 <td class=" padleft sc-nowrap"><?php echo $v['version_id']; ?></td>24 <td class=" padleft sc-nowrap"><?php echo date('d M Y H:i:s', strtotime($v['version_datetime'])); ?></td>25 <td class=" padleft sc-nowrap"><?php echo $v['editor']; ?></td>23 <td class="sc-padleft sc-nowrap"><?php echo $v['version_id']; ?></td> 24 <td class="sc-padleft sc-nowrap"><?php echo date('d M Y H:i:s', strtotime($v['version_datetime'])); ?></td> 25 <td class="sc-padleft sc-nowrap"><?php echo $v['editor']; ?></td> 26 26 </tr> 27 27 <?php
Note: See TracChangeset
for help on using the changeset viewer.