Skip to content

Commit

Permalink
pretty urls fixes, openid fix
Browse files Browse the repository at this point in the history
  • Loading branch information
voitto committed May 1, 2009
1 parent 0631420 commit 14d03a4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
5 changes: 4 additions & 1 deletion app/omb/plugins/omb.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,10 @@ function omb_request_munger( &$request, &$route ) {
foreach($omb_routes as $func) {
if (array_key_exists($func,$params)) {
// if found, lie to the mapper about the URI
$request->set('uri',$request->base."?".$func);
if (pretty_urls())
$request->set('uri',$request->base."".$func);
else
$request->set('uri',$request->base."?".$func);
$request->set('params', array($func));
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/omb/plugins/security.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ function _email( &$vars ) {
$return_to = $_SESSION['requested_url'];
else
$return_to = $request->base;
$protected_url = $request->base;
$protected_url = base_url(true);
$Identity =& $db->model('Identity');
if (isset($request->params['ident'])) {
$ident = $Identity->find_by('token',$request->params['ident']);
Expand Down Expand Up @@ -396,7 +396,7 @@ function _register( &$vars ) {
$return_to = $_SESSION['requested_url'];
else
$return_to = $request->base;
$protected_url = $request->base;
$protected_url = base_url(true);
if (isset($request->params['ident'])) {
$ident = $Identity->find_by('token',$request->params['ident']);
if ($ident) {
Expand Down Expand Up @@ -433,7 +433,7 @@ function _login( &$vars ) {
$return_to = $_SESSION['requested_url'];
else
$return_to = $request->base;
$protected_url = $request->base;
$protected_url = base_url(true);
if (isset($_SESSION['openid_url']))
$openid_url = $_SESSION['openid_url'];
else
Expand Down
7 changes: 6 additions & 1 deletion db/library/dbscript/_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2623,6 +2623,11 @@ function array_sort($array, $key, $max=false)
'+14' => 'Line Island'
);


function pretty_urls() {
global $pretty_url_base;
if (isset($pretty_url_base) && !empty($pretty_url_base))
return true;
return false;
}


5 changes: 4 additions & 1 deletion db/library/dbscript/mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,10 @@ function breadcrumbs() {
$links[] = '<a href="'. $this->base .'">Home</a>';

if ( isset( $this->resource ) && ( $this->resource != 'introspection' ))
$links[] = '<a href="'. $this->base .'?'.$this->resource.'">'.ucwords($this->resource).'</a>';
if (pretty_urls())
$links[] = '<a href="'. $this->base .''.$this->resource.'">'.ucwords($this->resource).'</a>';
else
$links[] = '<a href="'. $this->base .'?'.$this->resource.'">'.ucwords($this->resource).'</a>';

if ( ($this->id != 0) && isset( $this->resource ) && ( $this->resource != 'introspection' ))
$links[] = '<a href="'.$this->entry_url($this->id).'">Entry '.ucwords($this->id).'</a>';
Expand Down

0 comments on commit 14d03a4

Please sign in to comment.