1. A sub-site can inherit permissions of a parent site. 2. If you want to set up a different permission set for the sub-site you need to "stop inheriting" the parent site permissions. Do that! 3. Create your groups and Add users to them. 4. Grant Permissions(levels) to your Group. 5. Use the Default permission levels (Full Control, Design, Read, Contribute, Limited Access) or Simply Create your own permission levels.
Find If PHP Extension is Loaded
Use extension_loaded() to test whether a given extension is already available or not. This works on both built-in extensions and dynamically loaded ones.
http://php.net/manual/en/function.extension-loaded.php
List of Loaded Extensions
print_r(get_loaded_extensions());
Function to Check if an extension id loaded
function is_loaded ($php_extension) {
if (!extension_loaded($php_extension)) {
echo $php_extension. ' is NOT loaded';
}
else {
echo $php_extension. ' is loaded';
}
}
is_loaded ('gd');
Undo Stuffs with GIT
Modify your last commit (given no changes have been made )
git commit --amend git add missing_file git commit --amend
Unmodified Files
git checkout -- path to file
Unstage a file
git reset HEAD path to file
Undoing in GIT
http://book.git-scm.com/4_undoing_in_git_-_reset,_checkout_and_revert.html
ldap_connect() is confusing
So why is this code returning “Success” no matter what?
// LDAP variables
$ldaphost = "sdfsdfs";
$ldapport = '389';
// Connecting to LDAP
if (ldap_connect($ldaphost, $ldapport)){
echo 'Success';
}
else {
echo 'Failure';
}
From the PHP’s website:
Returns a positive LDAP link identifier on success, or FALSE on error. When OpenLDAP 2.x.x is used, ldap_connect() will always return a resource as it does not actually connect but just initializes the connecting parameters. The actual connect happens with the next calls to ldap_* funcs, usually with ldap_bind(). If no arguments are specified then the link identifier of the already opened link will be returned.
This sentence above should be rewritten completely.
Reset git bare repo
After playing around with GIT, it is time to get serious. My intent is to revert my bare repo to the state its was before i started playing around with it. I kinda like git, but this thing has a million (actually a few dozens) set of commands some of them make sense others not really.
http://schacon.github.com/git/git.html
How do i reset my bare repo to its original state?
First check the log so you can grab the SHA1 of the original commit
git log
Note that you cannot do a “git reset sde4545e4” on a bare repo you will like get this error:
“fatal: mixed reset is not allowed in a bare repository”.
Second run the following command
git update-ref HEAD sde4545e4
Now there are still left over objects on the system. If you check the ./git/objects folder, you will see a whole bunch of directories there. You will need to get rid of them.
Third get rid of unwanted objects
git gc git prune
