function _janrain_capture_get_local_screen in Janrain Registration 7.2
Same name and namespace in other branches
- 7.4 janrain_capture.module \_janrain_capture_get_local_screen()
1 call to _janrain_capture_get_local_screen()
File
- ./
janrain_capture.module, line 1103 - This module implements authentication endpoints for Janrain Capture.
Code
function _janrain_capture_get_local_screen($fname, $fromCache = FALSE) {
if (!$fromCache) {
$url = variable_get('janrain_capture_screens_folder');
$path = DRUPAL_ROOT . str_replace('file://', '', $url) . $fname;
}
else {
$path = sprintf('public://janrain_capture_screens/cache/%s', $fname);
}
if (file_exists($path) && is_readable($path)) {
return file_get_contents($path);
}
// problem encountered with the file
$message = 'Janrain Capture: Could not load screen file "@filename." Please make sure your screens folder is in' . ' the correct location.';
drupal_set_message(t($message, array(
'@filename' => $fname,
)), 'error');
return '';
}