Subversion Repositories php-qbpwcf

Rev

Rev 406 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 406 Rev 409
Line 4681... Line 4681...
4681
					
4681
					
4682
					}#if end
4682
					}#if end
4683
			
4683
			
4684
				}#if end
4684
				}#if end
4685
			
4685
			
4686
			/* 看起來怪怪的
-
 
4687
			
-
 
4688
			#如果新 RR 的 type 不是 A 且 value 不為 "." 結尾.
4686
			#如果新 RR 的 type 是 MX 或 CNAME 且 value 不為 "." 結尾.
4689
			if( $newRR["type"]!=="A" && $newRR["value"][strlen($newRR["value"])-1]!=="." ){
4687
			if( ( $newRR["type"]==="MX" || $newRR["type"]==="CNAME" ) && $newRR["value"][strlen($newRR["value"])-1]!=="." ){
4690
			
4688
			
4691
				#new RR add dot to value end.
4689
				#new RR add dot to value end.
4692
				$conf["add"][$nri]["value"]=$newRR["value"]=$newRR["value"].".";
4690
				$conf["add"][$nri]["value"]=$newRR["value"]=$newRR["value"].".";
4693
				
4691
				
4694
				#如果要debug
4692
				#如果要debug
Line 4750... Line 4748...
4750
					
4748
					
4751
					}#if end
4749
					}#if end
4752
			
4750
			
4753
				}#if end
4751
				}#if end
4754
			
4752
			
4755
			*/
-
 
4756
			
-
 
4757
			#針對 zone file 中既有的每個RR記錄
4753
			#針對 zone file 中既有的每個RR記錄
4758
			foreach($result["content"] as $index => $oldRR){
4754
			foreach($result["content"] as $index => $oldRR){
4759
			
4755
			
4760
				#如果既有的跟新的RR都為 $ORIGIN
4756
				#如果既有的跟新的RR都為 $ORIGIN
4761
				if($oldRR["type"]==="\$ORIGIN" && $newRR["type"]==="\$ORIGIN"){
4757
				if($oldRR["type"]==="\$ORIGIN" && $newRR["type"]==="\$ORIGIN"){
Line 9884... Line 9880...
9884
					
9880
					
9885
					#if enable debug
9881
					#if enable debug
9886
					if($debug){
9882
					if($debug){
9887
					
9883
					
9888
						#debug msg
9884
						#debug msg
9889
						echo "Creating ssl for domain name(".$cName.").".PHP_EOL;
9885
						echo "Updating ssl for domain name(".$cName.").".PHP_EOL;
9890
					
9886
					
9891
						}#if end
9887
						}#if end
9892
					
9888
					
9893
					#建立 certificate.crt 檔案
9889
					#建立 certificate.crt 檔案
9894
					#$cInfo["certPath"];
9890
					#$cInfo["certPath"];
Line 9948... Line 9944...
9948
						
9944
						
9949
						#if enable debug
9945
						#if enable debug
9950
						if($debug){
9946
						if($debug){
9951
						
9947
						
9952
							#debug msg
9948
							#debug msg
9953
							echo "There many cmd to run to valid domain name(".$cName.").".PHP_EOL;
9949
							echo "There are many cmd to run to enable ssl(".$cName.").".PHP_EOL;
9954
						
9950
						
9955
							}#if end
9951
							}#if end
9956
						
9952
						
9957
						#針對每個指令
9953
						#針對每個指令
9958
						foreach($action as $ac){
9954
						foreach($action as $ac){
Line 10158... Line 10154...
10158
					
10154
					
10159
					#if enable debug
10155
					#if enable debug
10160
					if($debug){
10156
					if($debug){
10161
					
10157
					
10162
						#debug msg
10158
						#debug msg
10163
						echo "Revoke old ssl(".$conf["info"]["share"]["apiDomain"].") on zerossl".PHP_EOL;
10159
						echo "Revoke old ssl(".$cName.") on zerossl(".$conf["info"]["share"]["apiDomain"].")".PHP_EOL;
10164
					
10160
					
10165
						}#if end
10161
						}#if end
10166
					
10162
					
10167
					#舊憑證於zerossl上的id
10163
					#舊憑證於zerossl上的id
10168
					#$oldCsrId
10164
					#$oldCsrId
Line 10206... Line 10202...
10206
							
10202
							
10207
								#if enable debug
10203
								#if enable debug
10208
								if($debug){
10204
								if($debug){
10209
								
10205
								
10210
									#debug msg
10206
									#debug msg
10211
									echo "Api endpoint busy, retry revoke old ssl(".$conf["info"]["share"]["apiDomain"].") on zerossl in 60 seconds".PHP_EOL;
10207
									echo "Api endpoint busy, retry revoke old ssl(".$cName.") on zerossl(".$conf["info"]["share"]["apiDomain"].") in 60 seconds".PHP_EOL;
10212
								
10208
								
10213
									}#if end
10209
									}#if end
10214
							
10210
							
10215
								#休息1分鐘
10211
								#休息1分鐘
10216
								sleep(60);
10212
								sleep(60);
Line 10238... Line 10234...
10238
						
10234
						
10239
					#if enable debug
10235
					#if enable debug
10240
					if($debug){
10236
					if($debug){
10241
					
10237
					
10242
						#debug msg
10238
						#debug msg
10243
						echo "Old ssl on zerossl(".$conf["info"]["share"]["apiDomain"].") revoked".PHP_EOL;
10239
						echo "Old ssl(".$cName.") on zerossl(".$conf["info"]["share"]["apiDomain"].") revoked".PHP_EOL;
10244
					
10240
					
10245
						}#if end
10241
						}#if end
10246
						
10242
						
10247
					}#if end
10243
					}#if end
10248
					
10244