setPassword() 공개 메소드

setPassword
public setPassword ( $padID, $password )
예제 #1
0
    }
} catch (Exception $e) {
    // the pad already exists or something else went wrong
    echo "\n\ngetPublicStatus Failed with message " . $e->getMessage();
}
/* Example: Set Public Status of a pad -- This only works for group pads */
try {
    $instance->setPublicStatus('testPad', true);
    // true or false
} catch (Exception $e) {
    // the pad already exists or something else went wrong
    echo "\n\nsetPublicStatus Failed with message " . $e->getMessage();
}
/* Example: Set Password on a pad -- This only works for group pads */
try {
    $instance->setPassword('testPad', 'aPassword');
} catch (Exception $e) {
    // the pad already exists or something else went wrong
    echo "\n\nsetPassword Failed with message " . $e->getMessage();
}
/* Example: Get true/false if the pad is password protected and include some logic -- This only works for group pads*/
try {
    $isPasswordProtected = $instance->isPasswordProtected('testPad');
    if ($isPasswordProtected->isPasswordprotected === false) {
        echo "Pad is not password protected\n\n";
    } else {
        echo "Pad is password protected\n\n";
    }
} catch (Exception $e) {
    // the pad already exists or something else went wrong
    echo "\n\nisPasswordProtected Failed with message " . $e->getMessage();