fix dreport redeliver
This commit is contained in:
		| @@ -16,17 +16,20 @@ class Dreport extends \Zotlabs\Web\Controller { | |||||||
| 		$channel = \App::get_channel(); | 		$channel = \App::get_channel(); | ||||||
| 		 | 		 | ||||||
| 		$mid = ((argc() > 1) ? argv(1) : ''); | 		$mid = ((argc() > 1) ? argv(1) : ''); | ||||||
|  | 		$encoded_mid = ''; | ||||||
|  |  | ||||||
| 		if(strpos($mid,'b64.') === 0) | 		if(strpos($mid,'b64.') === 0) { | ||||||
|  | 			$encoded_mid = $mid; | ||||||
| 			$mid = @base64url_decode(substr($mid,4)); | 			$mid = @base64url_decode(substr($mid,4)); | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		if($mid === 'push') { | 		if($mid === 'push') { | ||||||
| 			$table = 'push'; | 			$table = 'push'; | ||||||
| 			$mid = ((argc() > 2) ? argv(2) : ''); | 			$mid = ((argc() > 2) ? argv(2) : ''); | ||||||
|  |  | ||||||
| 			if(strpos($mid,'b64.') === 0) | 			if(strpos($mid,'b64.') === 0) { | ||||||
|  | 				$encoded_mid = $mid; | ||||||
| 				$mid = @base64url_decode(substr($mid,4)); | 				$mid = @base64url_decode(substr($mid,4)); | ||||||
|  | 			} | ||||||
|  |  | ||||||
| 			if($mid) {	 | 			if($mid) {	 | ||||||
| 				$i = q("select id from item where mid = '%s' and uid = %d and ( author_xchan = '%s' or ( owner_xchan = '%s' and item_wall = 1 )) ", | 				$i = q("select id from item where mid = '%s' and uid = %d and ( author_xchan = '%s' or ( owner_xchan = '%s' and item_wall = 1 )) ", | ||||||
| @@ -40,7 +43,7 @@ class Dreport extends \Zotlabs\Web\Controller { | |||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			sleep(3); | 			sleep(3); | ||||||
| 			goaway(z_root() . '/dreport/' . urlencode($mid)); | 			goaway(z_root() . '/dreport/' . (($encoded_mid) ? $encoded_mid : $mid)); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		if($mid === 'mail') { | 		if($mid === 'mail') { | ||||||
| @@ -158,7 +161,7 @@ class Dreport extends \Zotlabs\Web\Controller { | |||||||
| 		$o = replace_macros(get_markup_template('dreport.tpl'), array( | 		$o = replace_macros(get_markup_template('dreport.tpl'), array( | ||||||
| 			'$title' => sprintf( t('Delivery report for %1$s'),basename($mid)) . '...', | 			'$title' => sprintf( t('Delivery report for %1$s'),basename($mid)) . '...', | ||||||
| 			'$table' => $table, | 			'$table' => $table, | ||||||
| 			'$mid' => urlencode($mid), | 			'$mid' => (($encoded_mid) ? $encoded_mid : $mid), | ||||||
| 			'$options' => t('Options'), | 			'$options' => t('Options'), | ||||||
| 			'$push' => t('Redeliver'), | 			'$push' => t('Redeliver'), | ||||||
| 			'$entries' => $entries | 			'$entries' => $entries | ||||||
|   | |||||||
| @@ -3,11 +3,11 @@ | |||||||
| 		{{if $table == 'item'}} | 		{{if $table == 'item'}} | ||||||
| 		<div class="dropdown pull-right"> | 		<div class="dropdown pull-right"> | ||||||
| 			<button type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{{$options}}"> | 			<button type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{{$options}}"> | ||||||
| 				<i class="fa fa-sort-desc"></i> | 				<i class="fa fa-cog"></i> | ||||||
| 			</button> | 			</button> | ||||||
| 			<ul class="dropdown-menu"> | 			<div class="dropdown-menu"> | ||||||
| 				<li><a href="dreport/push/{{$mid}}">{{$push}}</a></li> | 				<a href="dreport/push/{{$mid}}" class="dropdown-item" >{{$push}}</a> | ||||||
| 			</ul> | 			</div> | ||||||
| 		</div> | 		</div> | ||||||
| 		{{/if}} | 		{{/if}} | ||||||
| 		<h2>{{$title}}</h2> | 		<h2>{{$title}}</h2> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user