CakePHP 2.0 has another aggressive security which is shown clearly when trying to make an ajax request to an action via method POST, it fires security error that says "Request is blackholed due to auth". The Solution to disable this aggressive validation for this action to set security attribute $validatePost to false. property SecurityComponent::$validatePost Set … Continue reading CakePHP 2 aggressive Security – continued
Month: February 2012
to clear openx cache clear openx/var/cache directory or by setting cache time by navigating to Configuration > Global Settings > Banner Delivery Settings
CakePHP has had CSRF protection since 1.2. For 2.0 the existing CSRF has a new more paranoid mode, and is its own standalone feature. By default a new CSRF token is generated for each request, and each token can only be used one. If a token is used twice, it will be blackholed. Sometimes, this … Continue reading CakePHP 2 Aggressive Security
How to make flash objects overlaid by another html elements? simply by using the wmode attribute and set it to transparent wmode - Possible values: window, direct, opaque, transparent, gpu. Sets the Window Mode property of the SWF file for transparency, layering, positioning, and rendering in the browser. If this attribute is omitted, the default value is "window". For more … Continue reading Flash objects overlay problem
function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = … Continue reading Javascript: dealing with cookies
Issue A SWF file in a layer on a DHTML page containing several layers displays above all the layers regardless of the layers' stacking order ("z-index"). Solution Use the WMODE parameter to allow layering of rich media content with DHTML layers. The WMODE parameter can be "window" (default), "opaque," or "transparent." Using a WMODE value … Continue reading SWF flash files ignore stacking order, play on top of DHTML layers
// Returns string Ex: "1.3.1" $().jquery; // Also returns string Ex: "1.3.1" jQuery.fn.jquery;
Obviously, if you've created a page specifically for iPhone and iPad users, the first thing you'll need to do is to find out when a user is visiting your site via an iPhone or iPad. Apple provides the iPad's user agent string, which appears as follows: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS … Continue reading Detecting the iPhone and iPad
$file = 'somefile.txt'; $remote_file = 'readme.txt'; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // upload a file if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo “successfully uploaded $file\n”; } else { echo “There was a problem while uploading $file\n”; } // close the connection … Continue reading FTP connections and file transfers
scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh. Examples: Copy the file "foobar.txt" from a remote host to the local host $ scp your_username@remotehost.edu:foobar.txt /some/local/directory Copy the file "foobar.txt" from the local host to a remote host … Continue reading Secure copy via ssh connection